In Ruby, it's possible for an array to contain itself, making it a recursive array. Is it possible to put a JavaScript array inside itself as well?
var arr = new Array();
arr[0] = "The next element of this array is the array itself."
Now how can I move arr
into arr[1]
so that the array contains itself recursively, (e. g., so that arr[1]
is arr
, arr[1][1]
contains arr
, arr[1][1][1]
contains arr
, etc.)?