Typescript Convert Array To String Javascript Substring Syntax