From fb308e5508a567460d65eb936a6949e3f9829b82 Mon Sep 17 00:00:00 2001 From: Dominic Lim <46486515+domlimm@users.noreply.github.com> Date: Thu, 18 Jan 2024 01:13:52 +0800 Subject: [PATCH] fix(curriculum): improve description and hint for clarity in Step 31 (#53233) --- .../64497e0e5e5a2c2329785af4.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-functional-programming-by-building-a-spreadsheet/64497e0e5e5a2c2329785af4.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-functional-programming-by-building-a-spreadsheet/64497e0e5e5a2c2329785af4.md index 94274ab2be7..0fa3e9b2a48 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-functional-programming-by-building-a-spreadsheet/64497e0e5e5a2c2329785af4.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-functional-programming-by-building-a-spreadsheet/64497e0e5e5a2c2329785af4.md @@ -9,11 +9,11 @@ dashedName: step-31 Spreadsheet software typically uses `=` at the beginning of a cell to indicate a calculation should be used, and spreadsheet functions should be evaluated. -Update your `if` condition to also check if the first character of `value` is `=`. +Use the `&&` operator to add a second condition to your `if` statement that also checks if the first character of `value` is `=`. # --hints-- -Your `if` condition should also check if the first character of `value` is `=`. You may use `[0]`, `.startsWith()`, or `.charAt(0)`. +You should use the `&&` operator to add a second condition to your `if` statement that also checks if the first character of `value` is `=`. You may use `[0]`, `.startsWith()`, or `.charAt(0)`. ```js assert.match(code, /const\s+update\s*=\s*\(?\s*event\s*\)?\s*=>\s*\{\s*const\s+element\s*=\s*event\.target;?\s*const\s+value\s*=\s*element\.value\.replace\(\s*\/\\s\/g\s*,\s*('|"|`)\1\s*\);?\s*if\s*\(\s*(!value\.includes\(\s*element\.id\s*\)\s*&&\s*(?:value\[0\]\s*===\s*('|"|`)=\3|value\.charAt\(0\)\s*===\s*('|"|`)=\4|value\.startsWith\(('|"|`)=\5\))|(?:value\[0\]\s*===\s*('|"|`)=\6|value\.charAt\(0\)\s*===\s*('|"|`)=\7|value\.startsWith\(('|"|`)=\8\))\s*\|\|\s*!value\.includes\(\s*element\.id\s*\))\s*\)\s*\{\s*\}/);