Here is the code:
let map = new Map()
map.set('a', 1)
map.keys().forEach(key=>console.log(key))
When I run it in the browser console, I get the keys logged as expected.
When I run it in Node.js environment(v18.18.0) I get this error:
Uncaught TypeError: map.keys(...).forEach is not a function
Any idea why it’s happening?