Typescript Change Last Element Of Array In Javascript W3schools