Cannot iterate through elements in JS [closed]

I am saving links as string into a array.

When I print the whole array, I prints out all the values:
enter image description here

When I try to access individual values, I just get ‘undefined’.
Eg: console.log(“First element: ” + WhatsappLinks[0]); returns First element: undefined

I save the values in the array using WhatsappLinks.push(/string value here/);

What am i doing wrong? WhatsappLinks.length also returns zero.

Tried iterating the array using a foreach function, but that also doesnt work.