Array.prototype.valuesadvancedconst arr = [1, 2, 3]
const a = [...arr.values()]
const b = [...arr[Symbol.iterator]()]
// a and b are identicalvalues() is equivalent to the default Symbol.iterator of an array.
The default array iterator (arr[Symbol.iterator]) is identical to arr.values. Both yield elements in index order, so spreading them produces the same result.
Implement valuesIteratorIsDefault which returns true if [...arr[Symbol.iterator]()].join() equals [...arr.values()].join().