4 ms·
http://jsperf.com/object-cycle-detection http://jsperf.com/object-cycle-detection I've added a jsPerf to see how bad it performs. For small objects it's reason
by vjeux 15y ago
http://jsperf.com/object-cycle-detection http://jsperf.com/object-cycle-detection
I've added a jsPerf to see how bad it performs. For small objects it's reasonable but if the object has 10 000 elements the Javascript test will take 1 second, which is not acceptable.
I'd rather give people a detection cycle detection library if their input may be circular.