[ad_1]
When I try “console.log” the whole array it shows, but when I try array.length or array[0] it is returning undefined and an empty array. I am pushing strings into an array from a Json file. In the screen shot below is the difference when logging a normal string array and my array which i think is the reason this is happening but I cant figure out how to fix it
enter image description here
Here is some of the thing that is not making sense for me
console.log(posts2); // returns 0: "Day #50" 1: "Ramadan Kareem" 2: "Freedom" 3: "Elife Unlimited" 4: "Wasel Gifts" length: 5
console.log(posts2.slice(0,2)); // returns empty array
[ad_2]