Back to Freecodecamp

Step 61

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

latest1.5 KB
Original Source

--description--

Now your call variable has the value "Testing". But your function is no longer using the name parameter.

Remove the name parameter from your function declaration, then remove your "CamperChan" string from the padRow call.

Also, remove both console.log from the padRow function.

--hints--

Your padRow function should not have a name parameter.

js
assert.notMatch(padRow.toString(), /name/);

You should not pass "CamperChan" to your padRow call.

js
assert.notMatch(__helpers.removeJSComments(code), /CamperChan/);

You should still call your padRow function.

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

You should not have a console.log before your return keyword.

js
assert.notMatch(padRow.toString(), /console.log\s*\(\s*('|"|`)This\s+works!\1\);\s+return\s+test;/);

You should not have a console.log after your return keyword.

js
assert.notMatch(padRow.toString(), /return\s+test;\s+console.log\s*\(\s*('|"|`)This\s+works!\1\);/);

--seed--

--seed-contents--

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

--fcc-editable-region--
function padRow(name) {
  const test = "Testing";
  console.log("This works!");
  return test;
  console.log("This works!");
}
const call = padRow("CamperChan");
console.log(call);
--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);