How To Convert Object Into Array In Typescript Vs Javascript