scrimba
Learn Modern JavaScript
Declare a Read-Only Variable with the const Keyword
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Declare a Read-Only Variable with the const Keyword
AboutCommentsNotes
Declare a Read-Only Variable with the const Keyword
Expand for more info
index.js
run
preview
console
function printManyTimes(str) {
"use strict";

var sentence = str + " is cool!";

sentence = str + " is amazing!"

for(var i = 0; i < str.length; i+=2) {
console.log(sentence);
}

}
printManyTimes("freeCodeCamp");
Console
index.html
-2:03