Maps the provided map into an array using the provided mapping function.
Map to be entered into an array
A mapping function to transform each pair into an item
console.log(map); // Map(5) { 0 => 5, 1 => 4, 2 => 3, 3 => 2, 4 => 1 }const arr = mapToArray(map, (_, value) => value);console.log(arr); // [5, 4, 3, 2, 1] Copy
console.log(map); // Map(5) { 0 => 5, 1 => 4, 2 => 3, 3 => 2, 4 => 1 }const arr = mapToArray(map, (_, value) => value);console.log(arr); // [5, 4, 3, 2, 1]
Maps the provided map into an array using the provided mapping function.