Array.prototype.valuesintermediateconst arr = [10, 20, 30]
const copy = [...arr.values()] // β [10, 20, 30]Spread values() into a new array to create a shallow copy using the iterator protocol.
Because values() returns an iterable iterator, you can spread it with [...arr.values()] to get a new array β a concise alternative to Array.from.
Implement spreadValues which uses the spread operator on arr.values() to produce a new array.