×
Past month
  • Any time
  • Past hour
  • Past 24 hours
  • Past week
  • Past month
  • Past year
All results
Apr 30, 2024 · You can create an empty map and add elements with the set() method: Example. // Create a Map const fruits = new Map(); // Set Map Values fruits.set("apples ...
Apr 30, 2024 · Returns an iterator object of the values in a Map. You can add elements to a map with the set() method: Example. // Create a Map const fruits = new Map();
Apr 30, 2024 · The set() method adds an element to a map. The set() method updates an element in a map. Syntax. map.set(key, value) ...
Apr 26, 2024 · Map.set(). You can add elements to a map with the set() method: Example. // Create a Map const fruits = new Map(); // Set Map Values fruits.set("apples", 500);
Apr 30, 2024 · The entries() method returns an iterator object with the [key,values] in a map. The entries() method returns does not change the original map. Syntax. map.
Apr 30, 2024 · The forEach() method invokes a function for each map element: The forEach() method does not change the original map. Syntax. map.forEach(callback). Parameters ...
Apr 30, 2024 · The size property returns the number of elements in a map. Syntax. map.size. Parameters. NONE. Return Value. Type ...
Apr 30, 2024 · The clear() method removes all the elements from a map. Syntax. map.clear(). Parameters. NONE. Return Value. NONE ...
2 days ago · The put() method writes an entry into the map. If an entry with the same key already exists then the value of that entry will be changed. Syntax. public V ...
2 days ago · All HashMap Methods ; merge(), Compute a value for an entry based on its key and value or write a specific value if the entry does not yet exist, V ; put(), Write ...