Is it possible for a JavaScript array to contain itself? -


in ruby, it's possible array contain itself, making recursive array. possible put javascript array inside well?

var arr = new array(); arr[0] = "the next element of array array itself." 

now how can move arr arr[1] array contains recursively, (e. g., arr[1] arr, arr[1][1] contains arr, arr[1][1][1] contains arr, etc.)?

sure:

var = [1]; a.push(a); 

they're same object:

a[1] === a[1][1]  // true 

and convincing screenshot:

enter image description here


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -