iteratea on values map js 1

iteratea on values map js

recipeMap.forEach((value, key) => {
	console.log(`${key} costs ${value}`);
});

Here is what the above code is Doing:
1. We create a new Map called recipeMap.
2. We add a few key-value pairs to the Map.
3. We use the forEach() method to loop through the Map.
4. We print out the key and value for each item in the Map.

Similar Posts