Array.prototype.entriesbeginnerconst arr = ['a', 'b', 'c']
const iter = arr.entries()
iter.next().value // β [0, 'a']
iter.next().value // β [1, 'b']Use entries() to get an iterator of [index, value] pairs from an array.
Array.prototype.entries() returns an iterator of [index, value] pairs for every element. You must consume the iterator β for example with Array.from() β to get a plain array.
Challenge: Implement getEntries(arr) that converts arr.entries() to a regular array of [index, value] pairs using Array.from().
getEntries(['a', 'b', 'c']) // β [[0, 'a'], [1, 'b'], [2, 'c']]
getEntries([]) // β []