I'm facing an issue where I have a string and an array, but I'm unable to push elements after the first iteration. Below is the code I'm using:
response1 = "hello";
var arr = [""];
arr.push(response1);
console.log("First position " + arr[0]);
console.log("Second position " + arr[1]);
console.log("Third position " + arr[2]);
On the third iteration, I am getting 'undefined' like the following:
First position
Second position hello
Third position undefined