Declare a Read-Only Variable with the const Keyword

Declare a Read-Only Variable with the const Keyword
0.0 0

#1

Tell us what’s happening:

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(str);
  }

  // change code above this line

}
printManyTimes("freeCodeCamp");

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 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


#2

Do you have a question?


#3

i hade a problem in const sentence and didnt know what is it


#4

The only that stands out to me is that you aren’t actually using your sentence anywhere in the code.


#5

i have found the solution sentences must be in upper case


#6

I also have the same problem…:confused:


#7

const sentence = “…”
must be
const SENTENCE = “…”


#8

thank you…:grinning: