undefinedfix
Sign in

How to compare the size of JS array circular reference

jakab922 edited in Fri, 23 Sep 2022
var a=[];
a[47]=[];
a[47]=[1];
a[46]=a;
a[45]=a;
console.log(a[46][46][46]===a[45][45][45],a[46][46])

Results true [< 45 empty items >, [circular], [circular], [1]]

Do you have any skills? I want to make a circular reference array, and judge whether the array elements are equal by subscript? What should we do

Online emergency waiting

2 Replies
barnabas
commented on Fri, 23 Sep 2022

The audience who asked you this question is more anxious than you

mxtqa
commented on Fri, 23 Sep 2022

I already know the answer