Tell us what’s happening:
I’m having trouble understanding why my code is not being accepted. The last pass condition fails and in the test window it says, ‘invalid regular expression flag s’
I have run this code externally in node and it seems to operate as expected.
Your code so far
function printManyTimes(str) {
"use strict";
// change code below this line
const SENTENCE = str + " is cool!";
for(let i = 0; i < str.length; i+=2) {
console.log(SENTENCE);
}
// change code above this line
}
printManyTimes("freeCodeCamp");
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/declare-a-read-only-variable-with-the-const-keyword/