Code change:
--- # --description-- <ins> 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. </ins> <del> 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. Each number, and the operator, should be in separate capture groups. 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. </del> <ins> Your function should return a boolean value. Remember that you can use the `test()` method for this. </ins> # --hints-- <del> You should declare a `regex` variable in your `highPrecedence` function. </del> <ins> You should declare a variable in your `highPrecedence` function for your regex. </ins> ```js <del> assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*(?:const|let|var)s+regex/); </del> <ins> assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*(?:const|let|var)s+w+/); </ins> ``` <del> You should use `const` to declare your `regex` variable. </del> <ins> You should use `const` to declare your regex variable. </ins> ```js <del> assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*consts+regex/); </del> <ins> assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*consts+w+/); </ins> ``` <del> Your `regex` variable should be a regular expression. </del> <ins> Your regex variable should contain a regular expression. </ins> ```js <del> assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*consts+regexs*=s*//); </del> <ins> assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*consts+w+s*=s*//); </ins> ``` <del> Your highPrecedence should return `regex.test(str);` </del> <ins> Your `highPrecedence` function should return a boolean value. </ins> ```js <del> assert.match(code, /returns+regex.test(str);?/); </del> <ins> assert.isBoolean(highPrecedence("12*2")); </ins> ``` <del> Please enter a properly functioning regex. </del> <ins> Your `highPrecedence` function should correctly check if the string matches the pattern of a number followed by a `*` or `/` operator followed by another number. </ins> ```js <del> assert.strictEqual(highPrecedence("5*3"), true); </del> <ins> assert.isTrue(highPrecedence("5*3")); assert.isFalse(highPrecedence("5")); assert.isTrue(highPrecedence("10/2")); assert.isFalse(highPrecedence("*")); </ins> ``` # --seed--

Related discussion:
text: The test you mentioned here only checks that the a regex variable was created and that some sort of regex is being used Currently this test is checking for the correct result js assert.strictEqual(highPrecedence("53"), true); but it right now allows for multiple incorrect answers My proposal is to rewrite the lesson to allow for more correct answers and ensure that incorrect answers don't pass. Right now, you have to create a regex variable and you have to return But there are dozens of correct answers and this should be rewritten to allow for that. So you can see my note here for my proposed changes The thing we want to be carefully about is not using regex tests to check for this. Because that is what is happening for the other lessons and it is difficult to maintain and only allows for a specific answer. So that is why this is marked as open for discussion
Opening this up for contribution - a PR which resolves this will follow Jessica's updated approach in to test the function result, regardless of the function implementation.