I was watching Douglas Crockford talk on javascript and he posted this question to solve.
function funky(o) {
o = null;
}
var x = [];
funky(x);
console.log(x); //output []
To my surprise x is still [] and not null. Why is that?
I was watching Douglas Crockford talk on javascript and he posted this question to solve.
function funky(o) {
o = null;
}
var x = [];
funky(x);
console.log(x); //output []
To my surprise x is still [] and not null. Why is that?