I am currently experimenting to determine whether a specific value already exists in an array.
In this scenario, the value of "node1" remains constant. The two arrays are exactly the same.
Yet, the same node is appended to the array twice despite the indexOf(node1) evaluation. http://jsfiddle.net/v9yxj5hm/2/
var tree_rows = [];
var node1 = ['Workplace','Revenue Overall',0];
if (tree_rows.indexOf(node1) == -1){ tree_rows.push(node1); }
node1 = ['Workplace','Revenue Overall',0];
if (tree_rows.indexOf(node1) == -1){ tree_rows.push(node1); }
alert(tree_rows)