Quick actions

cmd+k|ctrl+k

Navigation

Languages

ES6 sets

Snippet info

Language

JavaScript

Visibility

public

Author

petter

Created

2015-05-03T14:54:16Z

Updated

2015-05-03T14:54:16Z

let list = ['foo', 'bar', 'baz', 'foo'];
let set = new Set();

list.forEach(function(x) {
  set.add(x);
});

console.log("List length: " + list.length);
console.log("Set size: " + set.size);
INFO