This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.
Smartphone icons created by Freepik - Flaticon
Using Map.entries():
// Create a Map const fruits = new Map([ ["apples", 500], ["bananas", 300], ["oranges", 200] ]); let text = ""; for (const x of fruits.entries()) { text += x + "<br>"; } document.getElementById("demo").innerHTML = text;