Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript for loop Display a Text Five Times

// program to display text 5 times
const n = 5;

// looping from i = 1 to 5
for (let i = 1; i <= n; i++) {
    console.log(`I love JavaScript.`);
}
 
PREVIOUS NEXT
Tagged: #JavaScript #loop #Display #Text #Five #Times
ADD COMMENT
Topic
Name
8+7 =