Map
object provided here as a wrapper around a JavaScript object
. Create the following methods and operations on the Map object:
add
accepts a key, value
pair to add to the map.remove
accepts a key and removes the associated key, value
pairget
accepts a key
and returns the stored value
has
accepts a key
and returns true if the key exists or false if it doesn't.values
returns an array of all the values in the mapsize
returns the number of items in the mapclear
empties the map