Typescript For Each Item In Array Function