Tell us what’s happening:
Attempting to create a function that returns the sum of two numbers.
I have to the best of my knowledge created a function, declared a sum variable with the value of calling my “addTwoNumbers” function and provided it with two arguments (5 and 10).
When I log my sum variable the console shows the number 15 but the test fails, stating that “your function should return the sum of the two numbers”.
Any kick in the right direction would be appreciated I’ve gone back over the last 6 steps repeatedly
Your code so far
const character = "#";
const count = 8;
const rows = [];
function padRow(name) {
return name;
}
// User Editable Region
function addTwoNumbers(total) {
return total;
}
const sum = addTwoNumbers(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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 55