I’ve tried many codes but none of them worked and I don’t know how to pass.
Your code so far
const character = "#";
const count = 8;
const rows = [];
function padRow(name) {
return name;
}
// User Editable Region
function addTwoNumbers(sum) {
return sum;
};
const sum =(5,10);
console.log(sum);
// User Editable Region
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);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 54
Your addTwoNumbers function should return a sum of two numbers
which means your return statement should include a mathematical operation adding two numbers. Therefore, you need to have two parameters that will represent addTwoNumbers(5, 10) arguments.
Also, it would be best to assign the sum variable the addTwoNumbers function call with the arguments.