Regular Expressions - Using the Test Method

Tell us what’s happening:
Describe your issue in detail here.

The exercise code does not seeme to assign the return value of .test to a variable. Is this correct? Solution includes an assignment. (Same issue with following exercise…and others in this module)

let testStr = "freeCodeCamp";
let testRegex = /Code/;
testRegex.test(testStr);

Your code so far

let myString = "Hello, World!";
let myRegex = /Hello/;
let result = myRegex.test(myString); 

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36

Challenge: Regular Expressions - Using the Test Method

Link to the challenge:

in this challenge you should assign your output

in others it can be not needed because it’s the regex that is being tested

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.