I am still very new to programming and javascript. The problem I am facing now is I am not able to access the data inside array. Here is my code snippet
global.arr = [];
var id = 12;
for (var i=0; i<5; i++) {
arr.push(id);
id++;
}
console.log(arr);
console.log(arr[0]);

My question is that, how can I access into the data and what did i do wrong here?
Here is the code I currently have, it still doesn't seem to work:
var arr = [];
var id = 12;
for (var i=0; i<5; i++) {
arr.push(id);
id++;
}
console.log(arr);
console.log(arr[0]);
global === window?