Here is the code
var numberArray = [0, 1]
(function() {
numberArray.push(2)
function nestedFunction() {
numberArray.push(3)
function anotherNestedFunction() {
numberArray.push(4)
}
console.log(numberArray)
}
})()
I am expecting numberArray
with value [0,1,2,3,4]
but it is giving this error:
TypeError
:[0,1]
is not a function