Typescript Array Distinct Javascript Substring Syntax