Skip to content

Instantly share code, notes, and snippets.

@codemilli
Last active April 6, 2016 21:43
Show Gist options
  • Select an option

  • Save codemilli/c43ccd758bbdfd917c96010a9dec18ba to your computer and use it in GitHub Desktop.

Select an option

Save codemilli/c43ccd758bbdfd917c96010a9dec18ba to your computer and use it in GitHub Desktop.
let map = new Map();
let obj = {a: 'haha'};
map.set(obj, 'hihi').set(1, 1).set(1, 2);
console.log('map has 1 => ', map.has(1)); // true
console.log('value of 1 => ', map.get(1)); // 2
map.delete(1);
console.log('map has 1 => ', map.has(1)); // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment