Still new to Javascript.
I tried iterating over a Map object and printing the keys/values in the console. However it just returns undefined, even if I use the example from the Mozilla firefox documentation. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
eg,
const myMap = new Map()
myMap.set(0, 'zero')
myMap.set(1, 'one')
for (const [key, value] of myMap) {
console.log(key + ' = ' + value)
}
Does anybody know what might the problem here?
It seems to work on Chrome, but in Firefox console (Ubuntu VM) it only returns undefined.
You have disabled showing logs. Above the console, to the right of the filter there are buttons for different levels of messages you can enable or disable: Errors, Warnings, Logs, Info, Debug. All of these are currently disabled (toggled off) - you can recognise it by the white background.
The Logs also shows (2) which means that there are two log messages that have been filtered out from display:
You need to click on Logs to enable viewing the log messages. The background would change if it is enabled.