Typescript Count Array Javascript Length Converter