From b236d861fa2a68178bf2b95a4c2d5a00a1534728 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sun, 12 Nov 2023 09:58:48 +0300 Subject: [PATCH] fix(curriculum): test for the key value pair challenge (#52302) Co-authored-by: Jeremy L Thompson --- .../add-key-value-pairs-to-javascript-objects.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/add-key-value-pairs-to-javascript-objects.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/add-key-value-pairs-to-javascript-objects.md index 5bec1202dbb..99f116debcc 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/add-key-value-pairs-to-javascript-objects.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/add-key-value-pairs-to-javascript-objects.md @@ -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