JSFiddle - React, Tailwind, and code Playground

by Kishore Sahasranaman

JavaScript

function initList(){
list.push(1);
list.push(2);
}

var list = [];

initList(); // after this function I have some elements in `list`

var node = list[0]; //after the assignment firebug says `node` is undefined. `list[0]` is defined and contains object like {a:"value",b:"value1", ...}
console.log(node);