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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -