Typescript Count Array Javascript Append Text