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:

Comments
Post a Comment