Learn Introductory JavaScript by Building a Pyramid Generator - Step 54

// running tests
Your function should return the sum of the two numbers.
// tests completed
// console output
15

const character = "#";

const count = 8;

const rows = [];

function padRow(name) {

return name;

}

function addTwoNumbers(a, b) {

return 15;

}

const sum = addTwoNumbers(5, 10);

console.log(sum);

const call = padRow("CamperChan");

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 + "\n" + row;

}

console.log(result);

I honestly don’t know what went wrong and I am getting frustrated. Please help. It worked on Javascript Compiler but it always says “Your function should return the sum of the two numbers.”

Please post a link to the step.

This function always returns 15, no matter what a and b are. What should happen if a is 2 and b is 9?

Note: You aren’t really working with a compiler here. You’re seeing output from the interperter/engine.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.