Some fixes in 10_day_Sets_and_Maps.md

Fixed typos, wrong outputs, and indents in 10_day_Sets_and_Maps.md.
pull/304/head
Joseph Bak 4 years ago committed by GitHub
parent a22baede03
commit e1b87166e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -44,8 +44,8 @@
## Set ## Set
Set is a collection of elements. Set can only contains unique elements. Set is a collection of elements. Set can only contain unique elements.
Lets see how to create a set Let's see how to create a set
### Creating an empty set ### Creating an empty set
@ -55,7 +55,7 @@ console.log(companies)
``` ```
```sh ```sh
{} Set(0) {}
``` ```
### Creating set from array ### Creating set from array
@ -170,7 +170,7 @@ console.log(companies)
``` ```
```sh ```sh
{} Set(0) {}
``` ```
@ -202,7 +202,7 @@ console.log(counts)
``` ```
```js ```js
;[ [
{ lang: 'English', count: 3 }, { lang: 'English', count: 3 },
{ lang: 'Finnish', count: 1 }, { lang: 'Finnish', count: 1 },
{ lang: 'French', count: 2 }, { lang: 'French', count: 2 },
@ -345,7 +345,7 @@ Helsinki
### Checking key in Map ### Checking key in Map
Check if a key exist in a map using _has_ method. It returns _true_ or _false_. Check if a key exists in a map using _has_ method. It returns _true_ or _false_.
```js ```js
console.log(countriesMap.has('Finland')) console.log(countriesMap.has('Finland'))
@ -364,14 +364,14 @@ for (const country of countriesMap) {
``` ```
```sh ```sh
(2) ["Finland", "Helsinki"] ["Finland", "Helsinki"]
(2) ["Sweden", "Stockholm"] ["Sweden", "Stockholm"]
(2) ["Norway", "Oslo"] ["Norway", "Oslo"]
``` ```
```js ```js
for (const [country, city] of countriesMap){ for (const [country, city] of countriesMap){
console.log(country, city) console.log(country, city)
} }
``` ```

Loading…
Cancel
Save