Array.prototype.valuesbeginnerconst arr = ['x', 'y', 'z']
const iter = arr.values()
iter.next().value // β 'x'Use values() to get an iterator that yields each element of the array in order.
values() returns an Array Iterator that yields each value in the array. You can convert it to a plain array using Array.from.
Implement getValues which converts arr.values() to a regular array using Array.from.