How To Get First Value From Array In Typescript Vs Javascript