Link Search Menu Expand Document

Declare a Read-Only Variable with the const Keyword

Summary

  • The const keyword can be used to create read-only variables.

Final Code

function printManyTimes(str) {

  // Only change code below this line

  const SENTENCE = str + " is cool!";
  for (let i = 0; i < str.length; i+=2) {
    console.log(SENTENCE);
  }

  // Only change code above this line

}
printManyTimes("freeCodeCamp");