How do I convert an array to an iterator, such that I can call both next and done to iterate the array's values?
I've seen exhaustively that
an array is an iterable
but it doesn't have either property (const a = [1,2,3]; a.done; // returns undefined).
I've tried directly accessing the Symbol.iterator (const iter = a[Symbol.iterator];), but it simply returns function values() for the array.