Typescript Get Type In Array Javascript Append