Typescript Last Character Javascript Array Map Problems