Declare a Read-Only Variable with the const Keyword (Is test bugged?)

Declare a Read-Only Variable with the const Keyword (Is test bugged?)
0.0 0

#1

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/


#2

Did you search for the forum regarding this challenge? You will find there is a known bug if you do.


#3

Ah, ok. I’ll just circle back on this one later. Also, to anyone I may have thrown off with the above, the toString function above is not correct and just something I had thrown in trying to make this work.