Typescript Change Last Element Of Array Javascript W3schools