1const mySet = new Set();
2
3mySet.add(15);
4mySet.add(33);
5mySet.add(15);
6
7for(let item of mySet) {
8 console.log(item)
9 // expected output: 15
10 // expected output: 33
11}
1const myArray = ['hello', 'world'];
2
3// add an element to the end of the array
4myArray.push('foo'); // ['hello', 'world', 'foo']
5
6// add an element to the front of the array
7myArray.unshift('bar'); // ['bar', 'hello', 'world', 'foo']
8
9// add an element at an index of your choice
10// the first value is the index you want to add at
11// the second value is how many you want to delete (0 in this case)
12// the third value is the value you want to insert
13myArray.splice(2, 0, 'there'); // ['bar', 'hello', 'there', 'world', 'foo']
1//HOW TO ADD:
2var num1 = 4;
3var num2 = 6;
4var answer = 4 + 6; //You can do num1 + num2 here!
5function add(num1, num2) {
6 return num1 + num2;
7};
8console.log("4 + 6 is: " + add());
9console.log("I hope this helped!");