forked from freeCodeCamp/freeCodeCamp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(curriculum): add maps and sets workshop to FSD cert (freeCodeCam…
…p#57189) Co-authored-by: Tom <[email protected]>
- Loading branch information
Showing
36 changed files
with
3,570 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...nt/src/pages/learn/full-stack-developer/workshop-plant-nursery-catalog/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: Introduction to the Build a Plant Nursery Catalog | ||
block: workshop-plant-nursery-catalog | ||
superBlock: full-stack-developer | ||
--- | ||
|
||
## Introduction to the Build a Plant Nursery Catalog | ||
|
||
In this workshop, you will practice maps and sets by building a plant nursery catalog in JavaScript. |
141 changes: 141 additions & 0 deletions
141
curriculum/challenges/_meta/workshop-plant-nursery-catalog/meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
{ | ||
"name": "Build a Plant Nursery Catalog", | ||
"isUpcomingChange": true, | ||
"usesMultifileEditor": true, | ||
"hasEditableBoundaries": true, | ||
"dashedName": "workshop-plant-nursery-catalog", | ||
"blockType": "workshop", | ||
"blockLayout": "challenge-grid", | ||
"superBlock": "full-stack-developer", | ||
"challengeOrder": [ | ||
{ | ||
"id": "673339d96c56d36e963e888e", | ||
"title": "Step 1" | ||
}, | ||
{ | ||
"id": "6733b5632fb854bc6c58dc0d", | ||
"title": "Step 2" | ||
}, | ||
{ | ||
"id": "6733b5e6f210c1bd1afdf8b3", | ||
"title": "Step 3" | ||
}, | ||
{ | ||
"id": "67349ba230cff237c0f2bdf2", | ||
"title": "Step 4" | ||
}, | ||
{ | ||
"id": "67349d6e726b2c3c7f7301e8", | ||
"title": "Step 5" | ||
}, | ||
{ | ||
"id": "6734a13a29acdf47f2b8e161", | ||
"title": "Step 6" | ||
}, | ||
{ | ||
"id": "6734a2385c52c54d916a8b86", | ||
"title": "Step 7" | ||
}, | ||
{ | ||
"id": "6734a606e5968a5a19b77171", | ||
"title": "Step 8" | ||
}, | ||
{ | ||
"id": "6734b36f1a3ce17e73327f24", | ||
"title": "Step 9" | ||
}, | ||
{ | ||
"id": "6734a772196245601e4b80e0", | ||
"title": "Step 10" | ||
}, | ||
{ | ||
"id": "6734ab61e916486c80c490d1", | ||
"title": "Step 11" | ||
}, | ||
{ | ||
"id": "6734bbc0bd741598f942352e", | ||
"title": "Step 12" | ||
}, | ||
{ | ||
"id": "6734c10a327760a665b7d5b9", | ||
"title": "Step 13" | ||
}, | ||
{ | ||
"id": "6734eee1f9498cd90f9ae340", | ||
"title": "Step 14" | ||
}, | ||
{ | ||
"id": "6734f0ae9d1cf4dfd43a7805", | ||
"title": "Step 15" | ||
}, | ||
{ | ||
"id": "6734f6290ebd5cfbc75996af", | ||
"title": "Step 16" | ||
}, | ||
{ | ||
"id": "6734fa225c6667121e589f7e", | ||
"title": "Step 17" | ||
}, | ||
{ | ||
"id": "673762590f4bc1771c3a1e97", | ||
"title": "Step 18" | ||
}, | ||
{ | ||
"id": "67350acfd2006f2777295b96", | ||
"title": "Step 19" | ||
}, | ||
{ | ||
"id": "67351225403acd3d6f70ed6d", | ||
"title": "Step 20" | ||
}, | ||
{ | ||
"id": "6735145b0ee741461bdbaa49", | ||
"title": "Step 21" | ||
}, | ||
{ | ||
"id": "673521668be7905059b2d555", | ||
"title": "Step 22" | ||
}, | ||
{ | ||
"id": "673529d08c0d9c5a4193a465", | ||
"title": "Step 23" | ||
}, | ||
{ | ||
"id": "673788448f390305b34aa814", | ||
"title": "Step 24" | ||
}, | ||
{ | ||
"id": "6737a1a073a0d14c6544d301", | ||
"title": "Step 25" | ||
}, | ||
{ | ||
"id": "6737a5058ff3015829ce3265", | ||
"title": "Step 26" | ||
}, | ||
{ | ||
"id": "6737a95d5b431860f96ca7bb", | ||
"title": "Step 27" | ||
}, | ||
{ | ||
"id": "6737ac8e4fe7ae6b91c806bd", | ||
"title": "Step 28" | ||
}, | ||
{ | ||
"id": "6737c6d5d66b5cc3dac09c7b", | ||
"title": "Step 29" | ||
}, | ||
{ | ||
"id": "6738a5c704680355e29e077c", | ||
"title": "Step 30" | ||
}, | ||
{ | ||
"id": "6738a8035efec45acd8fdbf9", | ||
"title": "Step 31" | ||
}, | ||
{ | ||
"id": "6738ad2fd11775752d23ddc2", | ||
"title": "Step 32" | ||
} | ||
], | ||
"helpCategory": "JavaScript" | ||
} |
66 changes: 66 additions & 0 deletions
66
...ront-end-development/workshop-plant-nursery-catalog/673339d96c56d36e963e888e.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
id: 673339d96c56d36e963e888e | ||
title: Step 1 | ||
challengeType: 0 | ||
dashedName: step-1 | ||
--- | ||
|
||
# --description-- | ||
|
||
In this workshop, you'll build a plant nursery catalog while practicing JavaScript's Map and Set objects. | ||
|
||
To represent each plant in your catalog, you'll use objects, each with three properties: | ||
|
||
- `commonName`, the common name of the plant | ||
- `scientificName`, the scientific name (or latin name) of the plant | ||
- `cultivar`, the variety of the plant | ||
|
||
Start by creating an object with the three properties above for the `Spanish lavender` (scientific name `Lavandula stoechas`) of a cultivar called `Ballerina` and assign it to a variable named `ballerina`. | ||
|
||
# --hints-- | ||
|
||
You should have a variable named `ballerina`. | ||
|
||
```js | ||
assert.exists(ballerina); | ||
``` | ||
|
||
You should assign an object to your `ballerina` variable. | ||
|
||
```js | ||
assert.isObject(ballerina); | ||
``` | ||
|
||
Your `ballerina` object should have a `commonName` property set to `"Spanish lavender"`. | ||
|
||
```js | ||
assert.strictEqual(ballerina.commonName, "Spanish lavender"); | ||
``` | ||
|
||
Your `ballerina` object should have a `scientificName` property set to `"Lavandula stoechas"`. | ||
|
||
```js | ||
assert.strictEqual(ballerina.scientificName, "Lavandula stoechas"); | ||
``` | ||
|
||
Your `ballerina` object should have a `cultivar` property set to `"Ballerina"`. | ||
|
||
```js | ||
assert.strictEqual(ballerina.cultivar, "Ballerina"); | ||
``` | ||
|
||
Your `ballerina` object should have three keys. | ||
|
||
```js | ||
assert.lengthOf(Object.keys(ballerina), 3); | ||
``` | ||
|
||
# --seed-- | ||
|
||
## --seed-contents-- | ||
|
||
```js | ||
--fcc-editable-region-- | ||
|
||
--fcc-editable-region-- | ||
``` |
63 changes: 63 additions & 0 deletions
63
...ront-end-development/workshop-plant-nursery-catalog/6733b5632fb854bc6c58dc0d.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
id: 6733b5632fb854bc6c58dc0d | ||
title: Step 2 | ||
challengeType: 0 | ||
dashedName: step-2 | ||
--- | ||
|
||
# --description-- | ||
|
||
Now create another object, with the same three properties, to represent another cultivar of spanish lavender called `Pretty Polly`, and assign it to a variable named `prettyPolly`. | ||
|
||
# --hints-- | ||
|
||
You should have a variable named `prettyPolly`. | ||
|
||
```js | ||
assert.exists(prettyPolly); | ||
``` | ||
|
||
You should assign an object to your `prettyPolly` variable. | ||
|
||
```js | ||
assert.isObject(prettyPolly); | ||
``` | ||
|
||
Your `prettyPolly` object should have a `commonName` property set to `"Spanish lavender"`. | ||
|
||
```js | ||
assert.strictEqual(prettyPolly.commonName, "Spanish lavender"); | ||
``` | ||
|
||
Your `prettyPolly` object should have a `scientificName` property set to `"Lavandula stoechas"`. | ||
|
||
```js | ||
assert.strictEqual(prettyPolly.scientificName, "Lavandula stoechas"); | ||
``` | ||
|
||
Your `prettyPolly` object should have a `cultivar` property set to `"Pretty Polly"`. | ||
|
||
```js | ||
assert.strictEqual(prettyPolly.cultivar, "Pretty Polly"); | ||
``` | ||
|
||
Your `prettyPolly` object should have three keys. | ||
|
||
```js | ||
assert.lengthOf(Object.keys(prettyPolly), 3); | ||
``` | ||
|
||
# --seed-- | ||
|
||
## --seed-contents-- | ||
|
||
```js | ||
const ballerina = { | ||
commonName: "Spanish lavender", | ||
scientificName: "Lavandula stoechas", | ||
cultivar: "Ballerina" | ||
} | ||
--fcc-editable-region-- | ||
|
||
--fcc-editable-region-- | ||
``` |
77 changes: 77 additions & 0 deletions
77
...ront-end-development/workshop-plant-nursery-catalog/6733b5e6f210c1bd1afdf8b3.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
id: 6733b5e6f210c1bd1afdf8b3 | ||
title: Step 3 | ||
challengeType: 0 | ||
dashedName: step-3 | ||
--- | ||
|
||
# --description-- | ||
|
||
The remaining plant objects have been added for you. Now it's time to create your catalog. | ||
|
||
Like regular JavaScript objects, `Map` objects contain a collection of key-value pairs. To create a `Map` object, you can use the `Map` constructor: | ||
|
||
```js | ||
const myMap = new Map(); | ||
``` | ||
|
||
Declare a `catalog` variable and assign it a `Map` object. | ||
|
||
# --hints-- | ||
|
||
You should have a variable named `catalog`. | ||
|
||
```js | ||
assert.exists(catalog); | ||
``` | ||
|
||
You should assign a `Map` object to your `catalog` variable. | ||
|
||
```js | ||
assert.instanceOf(catalog, Map); | ||
``` | ||
|
||
# --seed-- | ||
|
||
## --seed-contents-- | ||
|
||
```js | ||
const ballerina = { | ||
commonName: "Spanish lavender", | ||
scientificName: "Lavandula stoechas", | ||
cultivar: "Ballerina" | ||
} | ||
|
||
const prettyPolly = { | ||
commonName: "Spanish lavender", | ||
scientificName: "Lavandula stoechas", | ||
cultivar: "Pretty Polly" | ||
} | ||
|
||
const willowVale = { | ||
commonName: "Spanish lavender", | ||
scientificName: "Lavandula stoechas", | ||
cultivar: "Willow Vale" | ||
} | ||
|
||
const hidcote = { | ||
commonName: "English lavender", | ||
scientificName: "Lavandula angustifolia", | ||
cultivar: "Hidcote" | ||
} | ||
|
||
const imperialGem = { | ||
commonName: "English lavender", | ||
scientificName: "Lavandula angustifolia", | ||
cultivar: "Imperial Gem" | ||
} | ||
|
||
const royalCrown = { | ||
commonName: "French lavender", | ||
scientificName: "Lavandula dentata", | ||
cultivar: "Royal Crown" | ||
} | ||
--fcc-editable-region-- | ||
|
||
--fcc-editable-region-- | ||
``` |
Oops, something went wrong.