educative.io

About the Sets category


#1

This chapter will look at how to work with Sets in JavaScript. We will see at how we can create Sets , access elements of a Set and various other functionalities on Sets.

View the lesson here.


#2

There is an error in the expectations of the Exercise 2.

From this,

setone.add(1);
setone.add(2);
setone.add(3);
settwo.add(3);
settwo.add(4);
settwo.add(5);

setone - settwo should give us a set of size 2 but a set of size 5 is being expected.