Skip to content

Commit

Permalink
fix(curriculum):Updated lessons in Number sorter project to better sh…
Browse files Browse the repository at this point in the history
…ow how ``inputValues`` works (#54445)
  • Loading branch information
sanskriti2005 committed Apr 24, 2024
1 parent 6781457 commit b0ff249
Show file tree
Hide file tree
Showing 40 changed files with 1,120 additions and 110 deletions.
Expand Up @@ -42,144 +42,156 @@
"title": "Step 7"
},
{
"id": "6407c303b4272606c019f338",
"id": "6621c5f02a5c272761db8661",
"title": "Step 8"
},
{
"id": "6407c4abf5be6d07d8c12ade",
"id": "6621d0dd6798b121bd2ed823",
"title": "Step 9"
},
{
"id": "6407c627ddc93708c8dee796",
"id": "662236690376072dc79d9c27",
"title": "Step 10"
},
{
"id": "6407c6a2c2159309994779a5",
"id": "6407c303b4272606c019f338",
"title": "Step 11"
},
{
"id": "6407c6d3f19c4e0a7ba320bb",
"id": "6407c4abf5be6d07d8c12ade",
"title": "Step 12"
},
{
"id": "6407c722498bc80b76d29073",
"id": "6407c627ddc93708c8dee796",
"title": "Step 13"
},
{
"id": "6410da6df463a606dfade96f",
"id": "6407c6a2c2159309994779a5",
"title": "Step 14"
},
{
"id": "6410dfb965c72108196ef24a",
"id": "6407c6d3f19c4e0a7ba320bb",
"title": "Step 15"
},
{
"id": "6410e1b58efc2c091a13bcd9",
"id": "6407c722498bc80b76d29073",
"title": "Step 16"
},
{
"id": "6410e3c19c21cd09c32dc7c6",
"id": "6410da6df463a606dfade96f",
"title": "Step 17"
},
{
"id": "6410e70c84bb660b4d2a5ea1",
"id": "6410dfb965c72108196ef24a",
"title": "Step 18"
},
{
"id": "6410edb33eeaf50dd9a22ab4",
"id": "6410e1b58efc2c091a13bcd9",
"title": "Step 19"
},
{
"id": "6410efff0ae97c0f06856511",
"id": "6410e3c19c21cd09c32dc7c6",
"title": "Step 20"
},
{
"id": "6410f9a443d57414ee50fada",
"id": "6410e70c84bb660b4d2a5ea1",
"title": "Step 21"
},
{
"id": "6410f149110ec60fd40fcfe1",
"id": "6410edb33eeaf50dd9a22ab4",
"title": "Step 22"
},
{
"id": "64110377201e7b1a0de0d558",
"id": "6410efff0ae97c0f06856511",
"title": "Step 23"
},
{
"id": "6410f97a721cd1144804b7a8",
"id": "6410f9a443d57414ee50fada",
"title": "Step 24"
},
{
"id": "6410fb3b68429716a810ea4b",
"id": "6410f149110ec60fd40fcfe1",
"title": "Step 25"
},
{
"id": "6410fcd1f731fd17cdb101a7",
"id": "64110377201e7b1a0de0d558",
"title": "Step 26"
},
{
"id": "6411024727181d190ef03166",
"id": "6410f97a721cd1144804b7a8",
"title": "Step 27"
},
{
"id": "64110727cefd3d1d9bdb0128",
"id": "6410fb3b68429716a810ea4b",
"title": "Step 28"
},
{
"id": "6411083020a3101e9514a0f5",
"id": "6410fcd1f731fd17cdb101a7",
"title": "Step 29"
},
{
"id": "64110998bc00321fd8052ab5",
"id": "6411024727181d190ef03166",
"title": "Step 30"
},
{
"id": "64110a03f6a450209b01f45c",
"id": "64110727cefd3d1d9bdb0128",
"title": "Step 31"
},
{
"id": "64110b1849454521871243ca",
"id": "6411083020a3101e9514a0f5",
"title": "Step 32"
},
{
"id": "6411108bc8b9c324f66aab4c",
"id": "64110998bc00321fd8052ab5",
"title": "Step 33"
},
{
"id": "641110e4fb696b259dbf0bcf",
"id": "64110a03f6a450209b01f45c",
"title": "Step 34"
},
{
"id": "6411135e9ee2fa26c882eb02",
"id": "64110b1849454521871243ca",
"title": "Step 35"
},
{
"id": "64112c9cf53d632910ea2f9b",
"id": "6411108bc8b9c324f66aab4c",
"title": "Step 36"
},
{
"id": "64112cea9e6ac22a314628b0",
"id": "641110e4fb696b259dbf0bcf",
"title": "Step 37"
},
{
"id": "64112d0943e1bb2aef11e2d1",
"id": "6411135e9ee2fa26c882eb02",
"title": "Step 38"
},
{
"id": "64112fa63a0f812c66499a54",
"id": "64112c9cf53d632910ea2f9b",
"title": "Step 39"
},
{
"id": "641130423e5f512d8972dae1",
"id": "64112cea9e6ac22a314628b0",
"title": "Step 40"
},
{
"id": "64113124efd2852edafaf25f",
"id": "64112d0943e1bb2aef11e2d1",
"title": "Step 41"
},
{
"id": "64113249bab9952fb2ce4469",
"id": "64112fa63a0f812c66499a54",
"title": "Step 42"
},
{
"id": "641130423e5f512d8972dae1",
"title": "Step 43"
},
{
"id": "64113124efd2852edafaf25f",
"title": "Step 44"
},
{
"id": "64113249bab9952fb2ce4469",
"title": "Step 45"
}
]
}
}
Expand Up @@ -7,9 +7,9 @@ dashedName: step-7

# --description--

You need to get the values from your `select` elements. However, these values are strings, and you need them to be numbers.
You need to get the values from your `select` elements. These values will currently be strings and you will convert them into numbers.

Since you have an array, you can use the `map` method to convert each value to a number. Do this by passing a callback function to `map` that takes a `dropdown` parameter and returns `Number(dropdown.value)`.
Use the `map` function to iterate over the array. Pass a callback function to `map` that takes a `dropdown` parameter and returns `dropdown.value`.

# --hints--

Expand All @@ -31,10 +31,10 @@ Your `map` callback function should take a `dropdown` parameter.
assert.match(code, /inputValues\s*=\s*\[\s*\.\.\.document\.getElementsByClassName\(\s*('|"|`)values-dropdown\1\s*\)\s*\]\s*\.map\s*\(\s*(\(\s*dropdown\s*\)|dropdown)\s*=>/);
```

Your `map` callback function should implicitly return `Number(dropdown.value)`.
Your `map` callback function should implicitly return `dropdown.value`.

```js
assert.match(code, /inputValues\s*=\s*\[\s*\.\.\.document\.getElementsByClassName\(\s*('|"|`)values-dropdown\1\s*\)\s*\]\s*\.map\s*\(\s*(\(\s*dropdown\s*\)|dropdown)\s*=>\s*Number\s*\(\s*dropdown\.value\s*\)/);
assert.match(code, /inputValues\s*=\s*\[\s*\.\.\.document\.getElementsByClassName\(\s*('|"|`)values-dropdown\1\s*\)\s*\]\s*\.map\s*\(\s*(\(\s*dropdown\s*\)|dropdown)\s*=>\s*dropdown\.value\s*/);
```

# --seed--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6407c303b4272606c019f338
title: Step 8
title: Step 11
challengeType: 0
dashedName: step-8
dashedName: step-11
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6407c4abf5be6d07d8c12ade
title: Step 9
title: Step 12
challengeType: 0
dashedName: step-9
dashedName: step-12
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6407c627ddc93708c8dee796
title: Step 10
title: Step 13
challengeType: 0
dashedName: step-10
dashedName: step-13
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6407c6a2c2159309994779a5
title: Step 11
title: Step 14
challengeType: 0
dashedName: step-11
dashedName: step-14
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6407c6d3f19c4e0a7ba320bb
title: Step 12
title: Step 15
challengeType: 0
dashedName: step-12
dashedName: step-15
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6407c722498bc80b76d29073
title: Step 13
title: Step 16
challengeType: 0
dashedName: step-13
dashedName: step-16
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6410da6df463a606dfade96f
title: Step 14
title: Step 17
challengeType: 0
dashedName: step-14
dashedName: step-17
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6410dfb965c72108196ef24a
title: Step 15
title: Step 18
challengeType: 0
dashedName: step-15
dashedName: step-18
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6410e1b58efc2c091a13bcd9
title: Step 16
title: Step 19
challengeType: 0
dashedName: step-16
dashedName: step-19
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6410e3c19c21cd09c32dc7c6
title: Step 17
title: Step 20
challengeType: 0
dashedName: step-17
dashedName: step-20
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6410e70c84bb660b4d2a5ea1
title: Step 18
title: Step 21
challengeType: 0
dashedName: step-18
dashedName: step-21
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6410edb33eeaf50dd9a22ab4
title: Step 19
title: Step 22
challengeType: 0
dashedName: step-19
dashedName: step-22
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6410efff0ae97c0f06856511
title: Step 20
title: Step 23
challengeType: 0
dashedName: step-20
dashedName: step-23
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6410f149110ec60fd40fcfe1
title: Step 22
title: Step 25
challengeType: 0
dashedName: step-22
dashedName: step-25
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6410f97a721cd1144804b7a8
title: Step 24
title: Step 27
challengeType: 0
dashedName: step-24
dashedName: step-27
---

# --description--
Expand Down
@@ -1,8 +1,8 @@
---
id: 6410f9a443d57414ee50fada
title: Step 21
title: Step 24
challengeType: 0
dashedName: step-21
dashedName: step-24
---

# --description--
Expand Down

0 comments on commit b0ff249

Please sign in to comment.