Typescript Update Item In Array Function Java