Typescript Count Array Javascript Mdn String