Skip to content

Commit 2e9e42c

Browse files
authored
fix(curriculum): update step 74 spreadsheet directions (freeCodeCamp#55667)
1 parent ac94a0b commit 2e9e42c

File tree

1 file changed

+15
-25
lines changed
  • curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-functional-programming-by-building-a-spreadsheet

1 file changed

+15
-25
lines changed

curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-functional-programming-by-building-a-spreadsheet/646d404259f512c1a9e86ac1.md

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,43 @@ dashedName: step-74
66
---
77

88
# --description--
9+
In your `highPrecedence` function, declare a variable using `const` and assign it a regex that checks if the string passed to the `str` parameter matches the pattern of a number followed by a `*` or `/` operator followed by another number.
910

10-
In your `highPrecedence` function, declare a `regex` variable. Assign it a regular expression that matches a number (including decimal numbers) followed by a `*` or `/` operator followed by another number.
11-
12-
Each number, and the operator, should be in separate capture groups.
13-
14-
Incorporate the regular expression you've defined into your `highPrecedence` function to test if the provided string `str` matches the pattern. Use the `test()` method on your `regex` variable and return the result.
11+
Your function should return a boolean value. Remember that you can use the `test()` method for this.
1512

1613
# --hints--
1714

18-
19-
You should declare a `regex` variable in your `highPrecedence` function.
15+
You should declare a variable in your `highPrecedence` function for your regex.
2016

2117
```js
22-
23-
assert.match(code, /const\s+highPrecedence\s*=\s*(\(\s*str\s*\)|str)\s*=>\s*{\s*(?:const|let|var)\s+regex/);
24-
18+
assert.match(code, /const\s+highPrecedence\s*=\s*(\(\s*str\s*\)|str)\s*=>\s*{\s*(?:const|let|var)\s+\w+/);
2519
```
2620

27-
You should use `const` to declare your `regex` variable.
21+
You should use `const` to declare your regex variable.
2822

2923
```js
30-
31-
assert.match(code, /const\s+highPrecedence\s*=\s*(\(\s*str\s*\)|str)\s*=>\s*{\s*const\s+regex/);
32-
24+
assert.match(code, /const\s+highPrecedence\s*=\s*(\(\s*str\s*\)|str)\s*=>\s*{\s*const\s+\w+/);
3325
```
3426

35-
Your `regex` variable should be a regular expression.
27+
Your regex variable should contain a regular expression.
3628

3729
```js
38-
39-
assert.match(code, /const\s+highPrecedence\s*=\s*(\(\s*str\s*\)|str)\s*=>\s*{\s*const\s+regex\s*=\s*\//);
40-
30+
assert.match(code, /const\s+highPrecedence\s*=\s*(\(\s*str\s*\)|str)\s*=>\s*{\s*const\s+\w+\s*=\s*\//);
4131
```
4232

43-
Your highPrecedence should return `regex.test(str);`
33+
Your `highPrecedence` function should return a boolean value.
4434

4535
```js
46-
assert.match(code, /return\s+regex\.test\(str\);?/);
47-
36+
assert.isBoolean(highPrecedence("12*2"));
4837
```
4938

50-
Please enter a properly functioning regex.
39+
Your `highPrecedence` function should correctly check if the string matches the pattern of a number followed by a `*` or `/` operator followed by another number.
5140

5241
```js
53-
54-
assert.strictEqual(highPrecedence("5*3"), true);
55-
42+
assert.isTrue(highPrecedence("5*3"));
43+
assert.isFalse(highPrecedence("5"));
44+
assert.isTrue(highPrecedence("10/2"));
45+
assert.isFalse(highPrecedence("*"));
5646
```
5747

5848
# --seed--

0 commit comments

Comments
 (0)