Typescript Array Distinct Javascript Substring Indexof