mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): improve description and hint for clarity in Step 31 (#53233)
This commit is contained in:
+2
-2
@@ -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*\}/);
|
||||
|
||||
Reference in New Issue
Block a user