Back to Freecodecamp

Step 56

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

latest987 B
Original Source

--description--

With that quick review complete, you should remove your addTwoNumbers function, sum variable, and log statement.

--hints--

You should not have a addTwoNumbers function in your code.

js
assert.notMatch(code, /addTwoNumbers/);

You should not have a sum variable in your code.

js
assert.notMatch(code, /sum/);

You should not log the sum variable.

js
assert.notMatch(code, /console\.log\(\s*sum\s*\)/);

--seed--

--seed-contents--

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

function padRow(name) {
  return name;
}
--fcc-editable-region--
function addTwoNumbers(num1, num2) {
  return num1 + num2;
}

const sum = addTwoNumbers(5, 10);
console.log(sum)

--fcc-editable-region--

const call = padRow();
console.log(call);


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);