Typescript Features Over Javascript Substring Indexof