Skip to content

Latest commit

 

History

History
21 lines (20 loc) · 1.22 KB

18-map-exercise.md

File metadata and controls

21 lines (20 loc) · 1.22 KB

Map Questions

  1. Create a new Map and add key-value pairs to it.
  2. Get the value of a specific key in a Map.
  3. Check if a key exists in a Map.
  4. Iterate over the keys of a Map using a for...of loop.
  5. Iterate over the values of a Map using a for...of loop.
  6. Iterate over the key-value pairs of a Map using a for...of loop.
  7. Convert a Map to an array of key-value pairs.
  8. Convert an array of key-value pairs to a Map.
  9. Use the forEach() method to iterate over the key-value pairs of a Map.
  10. Use the Map keys() method to get an iterator for the keys of a Map.
  11. Use the Map values() method to get an iterator for the values of a Map.
  12. Use the Map entries() method to get an iterator for the key-value pairs of a Map.
  13. Use the Map has() method to check if a Map contains a key.
  14. Use the Map get() method to get the value associated with a key in a Map.
  15. Use the Map set() method to add a new key-value pair to a Map.
  16. Use the Map delete() method to remove a key-value pair from a Map.
  17. Use the Map clear() method to remove all key-value pairs from a Map.
  18. Use the Object.fromEntries() method to create a new object from a Map.
  19. Use the Map constructor to create a new Map from an array of key-value pairs.