Your question is not very clear, what do you mean by "processed"?
var a = [];
This is an array literal, it assigns a reference to an empty array on.
function p(x) { a.push(x); }
Each time push () is called, a new element is added to the a.length index (i.e., it is always added after the highest index).
[[p(1),p(2)],p(3),[p(4),[p(5)]],p(6)]
This is an array literal that is equivalent to:
a = []; a[0] = [p(1),p(2)]; a[1] = p(3); a[2] = [p(4),[p(5)]]; a[3] = p(6);
The following expression:
a == [1,2,3,4,5,6]
always false, because arrays are objects and objects are never equal to any other object. You can do:
var a = [0, 1]; var b = a; a == b;
But
var a = [0, 1]; var b = [0, 1]; a == b;
source share