Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: JS3 syntax errors and typos #2218

Merged
merged 3 commits into from
Aug 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions content/lessons/js3/sublesson/objects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ environment.
2. **Shape**

```jsx
const. headers = () => {
const headers = () => {

}
```
Expand Down Expand Up @@ -1235,7 +1235,7 @@ environment.
`<h1>` tags.

```jsx
const ressult2 = headers(info)
const result2 = headers(info)
// result2 is '<h1>ironman: arrogant</h1><h1>spiderman: naive</h1><h1>hulk: strong</h1>'
```

Expand Down Expand Up @@ -1311,7 +1311,7 @@ environment.

```jsx
const result3 = headers(info)
// result3 is '<div><h1>ironman</h1><h2>arrogant</h2></div><div><h1>spiderman</h1><h2>arrogant</h2></div><div><h1>hulk</h1><h2>strong</h2></div>'
// result3 is '<div><h1>ironman</h1><h2>arrogant</h2></div><div><h1>spiderman</h1><h2>naive</h2></div><div><h1>hulk</h1><h2>strong</h2></div>'
```

<Spoiler>
Expand Down Expand Up @@ -1936,11 +1936,10 @@ object `{}`, to store the results.
common element.

```jsx
;[9, 8, 7, 8, 7, 7, 7].getMostCommon()[
;[9, 8, 7, 8, 7, 7, 7].getMostCommon()
// returns 7 because it is the most common element
SlyBouhafs marked this conversation as resolved.
Show resolved Hide resolved

('Batman', 8, 7, 'Batman', 'Robin')
].getMostCommon()
;['Batman', 8, 7, 'Batman', 'Robin'].getMostCommon()
// returns "Batman" because it is the most common element
```

Expand Down Expand Up @@ -1993,7 +1992,7 @@ frequency, then store these little objects in an array.

**Steps for Solution 1:**

- We need a local variable(let's call it `mapOfElments`) which stores the
- We need a local variable(let's call it `mapOfElements`) which stores the
`reduce` method attached to `this`.
- Inside the `reduce` method, build the object with the given array.
- We need another local variable(let's call it `mostCommon`) which stores:
Expand Down