mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-30 03:03:06 -05:00
fix(curriculum): test for the key value pair challenge (#52302)
Co-authored-by: Jeremy L Thompson <jeremy@jeremylt.org>
This commit is contained in:
@@ -81,13 +81,13 @@ The `foods` object should have a key `strawberries` with a value of `27`.
|
||||
assert(foods.strawberries === 27);
|
||||
```
|
||||
|
||||
The key-value pairs should be set using dot or bracket notation.
|
||||
The definition of the `foods` object should not be changed.
|
||||
|
||||
```js
|
||||
assert(
|
||||
code.search(/bananas:/) === -1 &&
|
||||
code.search(/grapes:/) === -1 &&
|
||||
code.search(/strawberries:/) === -1
|
||||
code.search(/let foods/) === -1 &&
|
||||
code.search(/const\s+foods\s*=\s*{\s*apples:\s*25,\s*oranges:\s*32,\s*plums:\s*28\s*};/
|
||||
) !== -1
|
||||
);
|
||||
```
|
||||
|
||||
@@ -96,7 +96,7 @@ assert(
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
let foods = {
|
||||
const foods = {
|
||||
apples: 25,
|
||||
oranges: 32,
|
||||
plums: 28
|
||||
@@ -112,7 +112,7 @@ console.log(foods);
|
||||
# --solutions--
|
||||
|
||||
```js
|
||||
let foods = {
|
||||
const foods = {
|
||||
apples: 25,
|
||||
oranges: 32,
|
||||
plums: 28
|
||||
|
||||
Reference in New Issue
Block a user