curriculum/challenges/english/blocks/learn-introductory-javascript-by-building-a-pyramid-generator/660f17d4e9f227d86e834abd.md
To generate a pyramid, you will need to create multiple rows. When you have to perform a task repeatedly until a condition is met, you will use a <dfn>loop</dfn>. There are many ways to write a loop.
You are going to start with a basic for loop. for loops use the following syntax:
for (iterator; condition; iteration) {
logic;
}
In the upcoming steps, you'll explore each component of a loop in detail. For now, construct a for loop that includes the terms "iterator", "condition", and "iteration" for the three components. Keep the loop <dfn>body</dfn>, the section within the curly braces {}, empty.
You should have a for loop.
assert.match(__helpers.removeJSComments(code), /for/);
The first component of your for loop should be the string "iterator".
assert.match(__helpers.removeJSComments(code), /for\s*\(\s*('|")iterator\1/);
The second component of your for loop should be the string "condition".
assert.match(__helpers.removeJSComments(code), /for\s*\(\s*('|")iterator\1\s*;\s*('|")condition\2/);
The third component of your for loop should be the string "iteration".
assert.match(__helpers.removeJSComments(code), /for\s*\(\s*('|")iterator\1\s*;\s*('|")condition\2\s*;\s*('|")iteration\3\s*\)/);
The body of your for loop should be empty.
assert.match(__helpers.removeJSComments(code), /for\s*\(\s*('|")iterator\1\s*;\s*('|")condition\2\s*;\s*('|")iteration\3\s*\)\s*\{\s*\}/);
const character = "#";
const count = 8;
const rows = [];
--fcc-editable-region--
--fcc-editable-region--