Sets are a new object type with ES6 (ES2015) that allow to create collections of unique values. The values in a set can be either simple primitives like strings or integers, but more complex object types like object literals or arrays can also be part of a set.

<!DOCTYPE html>
<html>
<head>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.29/browser.js"></script>
	<script type="text/babel">
		
		var books = new Set();
		books.add('Pride and Prejudice');
		books.add('War and Peace')
			 .add('Oliver Twist');

		console.log(books);
		console.log('how many books?', books.size);
		console.log('has Oliver Twist?', books.has('Oliver Twist'));
		books.delete('Oliver Twist');
		console.log('has Oliver Twist still?', books.has('Oliver Twist'));

		var data = [4,2,4,4,2,5,1,6,7,5,6,8,2,7];
		var set = new Set(data);
		console.log('data.length', data.length);
		console.log('set.size', set.size);


	</script>
	<title>Sets</title>
</head>
<body>	
</body>	
</html>