Typescript Change Index In Array Javascript Methods Syntax