Array assignment
Closed this issue · 0 comments
storrisi commented
I noticed a wrong assignment in the example you posted, in the getTree() function, which cause that the array passed to the getTree() function got modified after the assignment.
You should correct
item = data[0]
with
item = data.slice(0,1)[0],
and
item = data[i++];
with
var z = i++;
item = data.slice(z,z+1)[0];