Back to Freecodecamp

Step 49

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

latest1.1 KB
Original Source

--description--

You are calling your padRow function, but not doing anything with that function call. All functions in JavaScript <dfn>return</dfn> a value, meaning they provide the defined result of calling them for you to use elsewhere.

To see the result of calling your padRow function, declare a call variable and assign your existing padRow call to that variable.

--hints--

You should declare a call variable.

js
assert.match(__helpers.removeJSComments(code), /(const|let|var)\s+call/);

You should use const to declare your call variable.

js
assert.match(__helpers.removeJSComments(code), /const\s+call/);

You should assign call the result of your padRow call.

js
assert.match(__helpers.removeJSComments(code), /const\s+call\s*=\s*padRow\(\)/);

--seed--

--seed-contents--

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

function padRow() {

}
--fcc-editable-region--
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);