From baf650a3c795bc063cb53dad85f92e811287836e Mon Sep 17 00:00:00 2001 From: Averand1 <91491479+Averand1@users.noreply.github.com> Date: Wed, 7 May 2025 20:24:22 +0530 Subject: [PATCH] fix(curriculum): prevent hardcoding in addition functions (#60196) --- .../workshop-calculator/66cc095dfe1682753d2ab030.md | 6 ++++++ .../workshop-calculator/66cc0ba5881acb7692cfc4de.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/curriculum/challenges/english/25-front-end-development/workshop-calculator/66cc095dfe1682753d2ab030.md b/curriculum/challenges/english/25-front-end-development/workshop-calculator/66cc095dfe1682753d2ab030.md index b93920791a0..f09c820b520 100644 --- a/curriculum/challenges/english/25-front-end-development/workshop-calculator/66cc095dfe1682753d2ab030.md +++ b/curriculum/challenges/english/25-front-end-development/workshop-calculator/66cc095dfe1682753d2ab030.md @@ -27,6 +27,12 @@ Your `addTwoAndSeven` function should return the sum of `2` and `7`. assert.strictEqual(addTwoAndSeven(), 9); ``` +Your `addTwoAndSeven` function should return the sum using the `+` operator. + +```js +assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/); +``` + # --seed-- ## --seed-contents-- diff --git a/curriculum/challenges/english/25-front-end-development/workshop-calculator/66cc0ba5881acb7692cfc4de.md b/curriculum/challenges/english/25-front-end-development/workshop-calculator/66cc0ba5881acb7692cfc4de.md index ac0cd90eac5..8cc2bb8e565 100644 --- a/curriculum/challenges/english/25-front-end-development/workshop-calculator/66cc0ba5881acb7692cfc4de.md +++ b/curriculum/challenges/english/25-front-end-development/workshop-calculator/66cc0ba5881acb7692cfc4de.md @@ -27,6 +27,12 @@ Your `addThreeAndFour` function should return the sum of `3` and `4`. assert.equal(addThreeAndFour(), 7); ``` +Your `addThreeAndFour` function should return the sum using the `+` operator. + +```js +assert.match(code, /return\s*(3\s*\+\s*4|4\s*\+\s*3)\s*;?/); +``` + You should call the `addThreeAndFour` function inside a `console.log`. ```js