fix(curriculum): add review lessons for functions in pyramid project (#55127)

This commit is contained in:
Anne Deepa Prasanna
2024-06-10 22:16:45 +05:30
committed by GitHub
parent d7ceea325e
commit 02234419a9
65 changed files with 343 additions and 186 deletions

View File

@@ -220,252 +220,260 @@
"title": "Step 53"
},
{
"id": "6610c538372aa61cc0f5b122",
"id": "66643c93e05093c728abdbe9",
"title": "Step 54"
},
{
"id": "6610c6541c82551f95e765ab",
"id": "66643c9a9e0ad1c787f5fe2b",
"title": "Step 55"
},
{
"id": "6610c71600966a2191d3a64a",
"id": "6610c538372aa61cc0f5b122",
"title": "Step 56"
},
{
"id": "6610c77d50636722e5b6be17",
"id": "6610c6541c82551f95e765ab",
"title": "Step 57"
},
{
"id": "6610c83b52583e245a079217",
"id": "6610c71600966a2191d3a64a",
"title": "Step 58"
},
{
"id": "6610c87eac0f0b256d7b037e",
"id": "6610c77d50636722e5b6be17",
"title": "Step 59"
},
{
"id": "6610c8cfe4cf4d278e35c156",
"id": "6610c83b52583e245a079217",
"title": "Step 60"
},
{
"id": "660f2eccfe3f820304af1b39",
"id": "6610c87eac0f0b256d7b037e",
"title": "Step 61"
},
{
"id": "660f2fbd45b520046cac68e8",
"id": "6610c8cfe4cf4d278e35c156",
"title": "Step 62"
},
{
"id": "660f34626216270c682e2f7b",
"id": "660f2eccfe3f820304af1b39",
"title": "Step 63"
},
{
"id": "660f34e99571070d56d2f231",
"id": "660f2fbd45b520046cac68e8",
"title": "Step 64"
},
{
"id": "660f359af3e32e0f1a6880b7",
"id": "660f34626216270c682e2f7b",
"title": "Step 65"
},
{
"id": "660f374d532dc41189cc9cc2",
"id": "660f34e99571070d56d2f231",
"title": "Step 66"
},
{
"id": "660f383d4c772c12ff59904b",
"id": "660f359af3e32e0f1a6880b7",
"title": "Step 67"
},
{
"id": "660f38c34a4de6141c0c369f",
"id": "660f374d532dc41189cc9cc2",
"title": "Step 68"
},
{
"id": "660f3915b41a441537ec9f5e",
"id": "660f383d4c772c12ff59904b",
"title": "Step 69"
},
{
"id": "660f39b444fd6f16d1e49c1f",
"id": "660f38c34a4de6141c0c369f",
"title": "Step 70"
},
{
"id": "660f3b664421471aa595170f",
"id": "660f3915b41a441537ec9f5e",
"title": "Step 71"
},
{
"id": "660f3ba3cceef11b6ba08b59",
"id": "660f39b444fd6f16d1e49c1f",
"title": "Step 72"
},
{
"id": "660f3ce51f70571e1c5227c8",
"id": "660f3b664421471aa595170f",
"title": "Step 73"
},
{
"id": "660f3dd626be3a1ffe27e5d1",
"id": "660f3ba3cceef11b6ba08b59",
"title": "Step 74"
},
{
"id": "660f415b76859a2736771607",
"id": "660f3ce51f70571e1c5227c8",
"title": "Step 75"
},
{
"id": "660f4377a359972c521d3f4b",
"id": "660f3dd626be3a1ffe27e5d1",
"title": "Step 76"
},
{
"id": "660f4455f457ef2e3ec6920f",
"id": "660f415b76859a2736771607",
"title": "Step 77"
},
{
"id": "660f447efc0e722f016c1be0",
"id": "660f4377a359972c521d3f4b",
"title": "Step 78"
},
{
"id": "66458f0a05df478aa627629e",
"id": "660f4455f457ef2e3ec6920f",
"title": "Step 79"
},
{
"id": "664599653fcd6e97104f9261",
"id": "660f447efc0e722f016c1be0",
"title": "Step 80"
},
{
"id": "660f44f10ea40f300b896a5e",
"id": "66458f0a05df478aa627629e",
"title": "Step 81"
},
{
"id": "660f455b044d3230ed971e98",
"id": "664599653fcd6e97104f9261",
"title": "Step 82"
},
{
"id": "660f45ccf4ca5c31f253005a",
"id": "660f44f10ea40f300b896a5e",
"title": "Step 83"
},
{
"id": "6610bf6fa14d700beed1b109",
"id": "660f455b044d3230ed971e98",
"title": "Step 84"
},
{
"id": "660f46460f9c36330ebc07d8",
"id": "660f45ccf4ca5c31f253005a",
"title": "Step 85"
},
{
"id": "660f46b9c417a8341729a3ab",
"id": "6610bf6fa14d700beed1b109",
"title": "Step 86"
},
{
"id": "660f4774e3e0df35a68bb5f2",
"id": "660f46460f9c36330ebc07d8",
"title": "Step 87"
},
{
"id": "660f47afe4c98536715d5fa4",
"id": "660f46b9c417a8341729a3ab",
"title": "Step 88"
},
{
"id": "660f487dc0c8fa38084f9754",
"id": "660f4774e3e0df35a68bb5f2",
"title": "Step 89"
},
{
"id": "660f48a419b40238e2b8b4d5",
"id": "660f47afe4c98536715d5fa4",
"title": "Step 90"
},
{
"id": "660f48e1d3682f39e81843c4",
"id": "660f487dc0c8fa38084f9754",
"title": "Step 91"
},
{
"id": "660f4934fb48f63abd5ae371",
"id": "660f48a419b40238e2b8b4d5",
"title": "Step 92"
},
{
"id": "661483051820c3c1ab4595e0",
"id": "660f48e1d3682f39e81843c4",
"title": "Step 93"
},
{
"id": "660f4990b1caa03b9dc97a43",
"id": "660f4934fb48f63abd5ae371",
"title": "Step 94"
},
{
"id": "660f49e32001983c90b75850",
"id": "661483051820c3c1ab4595e0",
"title": "Step 95"
},
{
"id": "660f4a1472f8e63d76162ce5",
"id": "660f4990b1caa03b9dc97a43",
"title": "Step 96"
},
{
"id": "660f4a83373de83ea101685f",
"id": "660f49e32001983c90b75850",
"title": "Step 97"
},
{
"id": "660f4ae5b3924c3fc3373973",
"id": "660f4a1472f8e63d76162ce5",
"title": "Step 98"
},
{
"id": "660f4b33e2a3364094ecb540",
"id": "660f4a83373de83ea101685f",
"title": "Step 99"
},
{
"id": "660f4b641290da41b2cf0dd9",
"id": "660f4ae5b3924c3fc3373973",
"title": "Step 100"
},
{
"id": "660f4c3b01c44743719c99e4",
"id": "660f4b33e2a3364094ecb540",
"title": "Step 101"
},
{
"id": "660f4cde8dd305450514a1cb",
"id": "660f4b641290da41b2cf0dd9",
"title": "Step 102"
},
{
"id": "660f4cffb1459d45e34902d1",
"id": "660f4c3b01c44743719c99e4",
"title": "Step 103"
},
{
"id": "660f4de78f775e480ba2e451",
"id": "660f4cde8dd305450514a1cb",
"title": "Step 104"
},
{
"id": "660f4e74f7fd3f4a99ac2e50",
"id": "660f4cffb1459d45e34902d1",
"title": "Step 105"
},
{
"id": "660f4efcb8068e4cb470dca1",
"id": "660f4de78f775e480ba2e451",
"title": "Step 106"
},
{
"id": "660f4f79e2a82a4e92290f44",
"id": "660f4e74f7fd3f4a99ac2e50",
"title": "Step 107"
},
{
"id": "660f505d02b2bd513a1c3468",
"id": "660f4efcb8068e4cb470dca1",
"title": "Step 108"
},
{
"id": "660f50a21fe7645252804f2b",
"id": "660f4f79e2a82a4e92290f44",
"title": "Step 109"
},
{
"id": "660f5179b3b0ca558f6b4d4f",
"id": "660f505d02b2bd513a1c3468",
"title": "Step 110"
},
{
"id": "660f51f1df0a8757934a5796",
"id": "660f50a21fe7645252804f2b",
"title": "Step 111"
},
{
"id": "660f530d6e33d159e1bf4947",
"id": "660f5179b3b0ca558f6b4d4f",
"title": "Step 112"
},
{
"id": "660f535ec33a285b33af3774",
"id": "660f51f1df0a8757934a5796",
"title": "Step 113"
},
{
"id": "660f53ad3d39175c5d4335ac",
"id": "660f530d6e33d159e1bf4947",
"title": "Step 114"
},
{
"id": "660f540c2176ea5dec01306d",
"id": "660f535ec33a285b33af3774",
"title": "Step 115"
},
{
"id": "660f53ad3d39175c5d4335ac",
"title": "Step 116"
},
{
"id": "660f540c2176ea5dec01306d",
"title": "Step 117"
}
],
"helpCategory": "JavaScript"

View File

@@ -1,8 +1,8 @@
---
id: 660f2eccfe3f820304af1b39
title: Step 61
title: Step 63
challengeType: 1
dashedName: step-61
dashedName: step-63
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f2fbd45b520046cac68e8
title: Step 62
title: Step 64
challengeType: 1
dashedName: step-62
dashedName: step-64
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f34626216270c682e2f7b
title: Step 63
title: Step 65
challengeType: 1
dashedName: step-63
dashedName: step-65
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f34e99571070d56d2f231
title: Step 64
title: Step 66
challengeType: 1
dashedName: step-64
dashedName: step-66
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f359af3e32e0f1a6880b7
title: Step 65
title: Step 67
challengeType: 1
dashedName: step-65
dashedName: step-67
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f374d532dc41189cc9cc2
title: Step 66
title: Step 68
challengeType: 1
dashedName: step-66
dashedName: step-68
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f383d4c772c12ff59904b
title: Step 67
title: Step 69
challengeType: 1
dashedName: step-67
dashedName: step-69
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f38c34a4de6141c0c369f
title: Step 68
title: Step 70
challengeType: 1
dashedName: step-68
dashedName: step-70
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f3915b41a441537ec9f5e
title: Step 69
title: Step 71
challengeType: 1
dashedName: step-69
dashedName: step-71
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f39b444fd6f16d1e49c1f
title: Step 70
title: Step 72
challengeType: 1
dashedName: step-70
dashedName: step-72
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f3b664421471aa595170f
title: Step 71
title: Step 73
challengeType: 1
dashedName: step-71
dashedName: step-73
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f3ba3cceef11b6ba08b59
title: Step 72
title: Step 74
challengeType: 1
dashedName: step-72
dashedName: step-74
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f3ce51f70571e1c5227c8
title: Step 73
title: Step 75
challengeType: 1
dashedName: step-73
dashedName: step-75
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f3dd626be3a1ffe27e5d1
title: Step 74
title: Step 76
challengeType: 1
dashedName: step-74
dashedName: step-76
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f415b76859a2736771607
title: Step 75
title: Step 77
challengeType: 1
dashedName: step-75
dashedName: step-77
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4377a359972c521d3f4b
title: Step 76
title: Step 78
challengeType: 1
dashedName: step-76
dashedName: step-78
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4455f457ef2e3ec6920f
title: Step 77
title: Step 79
challengeType: 1
dashedName: step-77
dashedName: step-79
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f447efc0e722f016c1be0
title: Step 78
title: Step 80
challengeType: 1
dashedName: step-78
dashedName: step-80
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f44f10ea40f300b896a5e
title: Step 81
title: Step 83
challengeType: 1
dashedName: step-81
dashedName: step-83
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f455b044d3230ed971e98
title: Step 82
title: Step 84
challengeType: 1
dashedName: step-82
dashedName: step-84
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f45ccf4ca5c31f253005a
title: Step 83
title: Step 85
challengeType: 1
dashedName: step-83
dashedName: step-85
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f46460f9c36330ebc07d8
title: Step 85
title: Step 87
challengeType: 1
dashedName: step-85
dashedName: step-87
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f46b9c417a8341729a3ab
title: Step 86
title: Step 88
challengeType: 1
dashedName: step-86
dashedName: step-88
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4774e3e0df35a68bb5f2
title: Step 87
title: Step 89
challengeType: 1
dashedName: step-87
dashedName: step-89
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f47afe4c98536715d5fa4
title: Step 88
title: Step 90
challengeType: 1
dashedName: step-88
dashedName: step-90
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f487dc0c8fa38084f9754
title: Step 89
title: Step 91
challengeType: 1
dashedName: step-89
dashedName: step-91
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f48a419b40238e2b8b4d5
title: Step 90
title: Step 92
challengeType: 1
dashedName: step-90
dashedName: step-92
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f48e1d3682f39e81843c4
title: Step 91
title: Step 93
challengeType: 1
dashedName: step-91
dashedName: step-93
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4934fb48f63abd5ae371
title: Step 92
title: Step 94
challengeType: 1
dashedName: step-92
dashedName: step-94
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4990b1caa03b9dc97a43
title: Step 94
title: Step 96
challengeType: 1
dashedName: step-94
dashedName: step-96
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f49e32001983c90b75850
title: Step 95
title: Step 97
challengeType: 1
dashedName: step-95
dashedName: step-97
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4a1472f8e63d76162ce5
title: Step 96
title: Step 98
challengeType: 1
dashedName: step-96
dashedName: step-98
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4a83373de83ea101685f
title: Step 97
title: Step 99
challengeType: 1
dashedName: step-97
dashedName: step-99
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4ae5b3924c3fc3373973
title: Step 98
title: Step 100
challengeType: 1
dashedName: step-98
dashedName: step-100
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4b33e2a3364094ecb540
title: Step 99
title: Step 101
challengeType: 1
dashedName: step-99
dashedName: step-101
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4b641290da41b2cf0dd9
title: Step 100
title: Step 102
challengeType: 1
dashedName: step-100
dashedName: step-102
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4c3b01c44743719c99e4
title: Step 101
title: Step 103
challengeType: 1
dashedName: step-101
dashedName: step-103
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4cde8dd305450514a1cb
title: Step 102
title: Step 104
challengeType: 1
dashedName: step-102
dashedName: step-104
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4cffb1459d45e34902d1
title: Step 103
title: Step 105
challengeType: 1
dashedName: step-103
dashedName: step-105
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4de78f775e480ba2e451
title: Step 104
title: Step 106
challengeType: 1
dashedName: step-104
dashedName: step-106
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4e74f7fd3f4a99ac2e50
title: Step 105
title: Step 107
challengeType: 1
dashedName: step-105
dashedName: step-107
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4efcb8068e4cb470dca1
title: Step 106
title: Step 108
challengeType: 1
dashedName: step-106
dashedName: step-108
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f4f79e2a82a4e92290f44
title: Step 107
title: Step 109
challengeType: 1
dashedName: step-107
dashedName: step-109
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f505d02b2bd513a1c3468
title: Step 108
title: Step 110
challengeType: 1
dashedName: step-108
dashedName: step-110
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f50a21fe7645252804f2b
title: Step 109
title: Step 111
challengeType: 1
dashedName: step-109
dashedName: step-111
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f5179b3b0ca558f6b4d4f
title: Step 110
title: Step 112
challengeType: 1
dashedName: step-110
dashedName: step-112
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f51f1df0a8757934a5796
title: Step 111
title: Step 113
challengeType: 1
dashedName: step-111
dashedName: step-113
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f530d6e33d159e1bf4947
title: Step 112
title: Step 114
challengeType: 1
dashedName: step-112
dashedName: step-114
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f535ec33a285b33af3774
title: Step 113
title: Step 115
challengeType: 1
dashedName: step-113
dashedName: step-115
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f53ad3d39175c5d4335ac
title: Step 114
title: Step 116
challengeType: 1
dashedName: step-114
dashedName: step-116
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 660f540c2176ea5dec01306d
title: Step 115
title: Step 117
challengeType: 1
dashedName: step-115
dashedName: step-117
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 6610bf6fa14d700beed1b109
title: Step 84
title: Step 86
challengeType: 1
dashedName: step-84
dashedName: step-86
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 6610c538372aa61cc0f5b122
title: Step 54
title: Step 56
challengeType: 1
dashedName: step-54
dashedName: step-56
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 6610c6541c82551f95e765ab
title: Step 55
title: Step 57
challengeType: 1
dashedName: step-55
dashedName: step-57
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 6610c71600966a2191d3a64a
title: Step 56
title: Step 58
challengeType: 1
dashedName: step-56
dashedName: step-58
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 6610c77d50636722e5b6be17
title: Step 57
title: Step 59
challengeType: 1
dashedName: step-57
dashedName: step-59
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 6610c83b52583e245a079217
title: Step 58
title: Step 60
challengeType: 1
dashedName: step-58
dashedName: step-60
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 6610c87eac0f0b256d7b037e
title: Step 59
title: Step 61
challengeType: 1
dashedName: step-59
dashedName: step-61
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 6610c8cfe4cf4d278e35c156
title: Step 60
title: Step 62
challengeType: 1
dashedName: step-60
dashedName: step-62
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 661483051820c3c1ab4595e0
title: Step 93
title: Step 95
challengeType: 1
dashedName: step-93
dashedName: step-95
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 66458f0a05df478aa627629e
title: Step 79
title: Step 81
challengeType: 1
dashedName: step-79
dashedName: step-81
---
# --description--

View File

@@ -1,8 +1,8 @@
---
id: 664599653fcd6e97104f9261
title: Step 80
title: Step 82
challengeType: 1
dashedName: step-80
dashedName: step-82
---
# --description--

View File

@@ -0,0 +1,80 @@
---
id: 66643c93e05093c728abdbe9
title: Step 54
challengeType: 1
dashedName: step-54
---
# --description--
Before moving on, take a moment to review how functions work.
Declare a function named `addTwoNumbers`. This function should take two arguments and return the sum of those two arguments.
Then declare a `sum` variable and assign it the value of calling your `addTwoNumbers` function with `5` and `10` as the arguments. Log the `sum` variable to the console.
# --hints--
You should have a function called `addTwoNumbers`.
```js
assert.isFunction(addTwoNumbers);
```
Your function should return the sum of the two numbers.
```js
assert.strictEqual(addTwoNumbers(2,3), 5);
```
You should declare a `sum` variable.
```js
assert.isDefined(sum);
```
You should assign `sum` the value from calling the `addTwoNumbers` function with `5` and `10` for the arguments.
```js
assert.strictEqual(sum, 15);
```
You should log your `sum` variable.
```js
assert.match(code, /console\.log\(\s*sum\s*\)/);
```
# --seed--
## --seed-contents--
```js
const character = "#";
const count = 8;
const rows = [];
function padRow(name) {
return name;
}
--fcc-editable-region--
--fcc-editable-region--
const call = padRow("CamperChan");
console.log(call);
for (let i = 0; i < count; i = i + 1) {
rows.push(character.repeat(i + 1))
}
let result = ""
for (const row of rows) {
result = result + "\n" + row;
}
console.log(result);
```

View File

@@ -0,0 +1,69 @@
---
id: 66643c9a9e0ad1c787f5fe2b
title: Step 55
challengeType: 1
dashedName: step-55
---
# --description--
With that quick review complete, you should remove your `addTwoNumbers` function, `sum` variable, and log statement.
# --hints--
You should not have a `addTwoNumbers` function in your code.
```js
assert.notMatch(code, /addTwoNumbers/);
```
You should not have a `sum` variable in your code.
```js
assert.notMatch(code, /sum/);
```
You should not log the `sum` variable.
```js
assert.notMatch(code, /console\.log\(\s*sum\s*\)/);
```
# --seed--
## --seed-contents--
```js
const character = "#";
const count = 8;
const rows = [];
function padRow(name) {
return name;
}
--fcc-editable-region--
function addTwoNumbers(num1, num2) {
return num1 + num2;
}
const sum = addTwoNumbers(5, 10);
console.log(sum)
--fcc-editable-region--
const call = padRow();
console.log(call);
for (let i = 0; i < count; i = i + 1) {
rows.push(character.repeat(i + 1))
}
let result = ""
for (const row of rows) {
result = result + "\n" + row;
}
console.log(result);
```