ES6: Declare a Read-Only Variable with the const Keyword

Tell us what’s happening:
I don’t know why the last test is not passing. It says i should change console.log(); to get the SENTENCE variable, which I did. Am I missing something?

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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/declare-a-read-only-variable-with-the-const-keyword/

3 Likes

I’m getting the same error and I’m also not sure why. Any luck figuring it out?

When I run if with firefox the test box says “invalid regular expression flag s” and when I tried running it on Chrome instead I got an “Unexpected token ?” error. And both are telling me to change console.log(); to get the SENTENCE variable, which I’ve done.

I got the same error message.

I reported it as a bug. Multiple people getting the same error in the last few hours on such a straight-forward lesson is suspicious.

1 Like

Did you report it on Github?

i also got the same error message .

Yes, I couldn’t find any matching issues so I opened a new one.

2 Likes

Same error message :frowning:

Yes, it is a bug. The regex that verifies the console.log(SENTENCE); is broken :slightly_smiling_face:

1 Like

may i know is this bug already fixed?

It’s being fixed. My PR is still pending :slight_smile:

Should we log in again? Thanks for fixing!

Have the same error message, tried it with Chrome, Firefox and Safari.

Thanks. So it means the changes still not implemented yet on live site?

My PR have been approved and merged but I can’t see the reflecting changes right now. Maybe we should wait a little bit longer :slight_smile:

I’m still getting this error.

Same here for the past 36 hrs. Hopefully it’ll get fixed soon. Would love to move forward :slight_smile:

I am still getting this error, why isn’t it fixed yet ??

Not just me being a numpty then :slight_smile:

Also happening to me too, I wonder if anyone has actually passed this section!?