This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
1. create an empty set
const countries = new Set()
console.log(countries)
2. Create a set containing 0 to 10 using loop
const set = new Set()
set.add(0,)
set.add(1)
set.add(2)
set.add(3)
set.add(4)
set.add(5)
set.add(6)
set.add(7)
set.add(8)
set.add(9)
set.add(10)
console.log(set)
3. Remove an element from a set
const set = new Set()
set.add(0,)
set.add(1)
set.add(2)
console.log(set.delete(1))
4. Clear a set
const set = new Set()
set.add(0,)
set.add(1)
set.add(2)
set.clear()
console.log(set)
5. Create a set of 5 string elements from array
const arr = ['ayşe','fatma','dilan','cansu']
const set = new Set(arr)
console.log(set)
6. Create a map of countries and number of characters of a country
const map = new Map()
map.set(1,'turkey')
map.set(2,'russıa')
map.set(3,'germaby')
console.log(map)
### Exercise Level 2
1. Find a union b
```js
//app.js
consta=[4,5,8,9]
constb=[3,4,5,7]
constc=[...a,...b
]
constA=newSet(a)
constB=newSet(b)
constC=newSet(c)
console.log(C)
```
2. Find a intersection b
```js
//app.js
consta=[4,5,8,9]
constb=[3,4,5,7]
constA=newSet(a)
constB=newSet(b)
constaUnionB=a.filter((num)=>B.has(num))
console.log(aUnionB)
```
3. Find a with b
```js
//app.js
consta=[4,5,8,9]
constb=[3,4,5,7]
constA=newSet(a)
constB=newSet(b)
constaUnionB=a.filter((num)=>!B.has(num))
console.log(aUnionB)
```
### Exercises Level 3
1. How many languages are there in the countries object file.
2. Use the countries data to find the 10 most spoken languages: