Back to Freecodecamp

Step 48

curriculum/challenges/english/blocks/learn-introductory-javascript-by-building-a-pyramid-generator/6610c105bbdacc114d6cdc44.md

latest986 B
Original Source

--description--

In order to use a function, you need to call it. A <dfn>function call</dfn> tells your application to run the code from the function wherever you choose to call it. The syntax for a function call is the function name followed by parentheses. For example, this code defines and calls a test function.

js
function test() {

}
test();

Call your padRow function.

--hints--

You should call the padRow function.

js
assert.lengthOf(__helpers.removeJSComments(code).match(/padRow\(\)/g), 2);

Your padRow function body should be empty.

js
assert.match(padRow.toString(), /\{\s*\}/);

--seed--

--seed-contents--

js
const character = "#";
const count = 8;
const rows = [];

--fcc-editable-region--
function padRow() {

}

--fcc-editable-region--


for (let i = 0; i < count; i = i + 1) {
  rows.push(character.repeat(i + 1))
}

let result = ""

for (const row of rows) {
  result = result + row + "\n";
}

console.log(result);