Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

I’m still getting an error on following code, what am I doing wrong in following code.

Your code so far

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

function padRow(name) {

// User Editable Region

function addTwoNumbers(num1, num2) {
  return num1 + num2;
}
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 + row + "\n";
}

//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/141.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Welcome to the forum @munamg

There is a syntax error in the console:

SyntaxError: unknown: Unexpected token (33:22)

31 | }
32 |

33 | //console.log(result);
| ^

Start at the top of your code, look for any incorrect code.

Happy coding

HI,

I’m still getting an error after I fixed the syntax error.

what error are you getting?

Tell us what’s happening:

I am still getting an error after I fixed the syntax error.

Your code so far

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

function padRow(name) {

// User Editable Region

function addTwoNumbers(num1, num2) {
  return num1 + num2;
}
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 + row + "\n";
}
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/141.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

why do you think this is not a syntax error?

reset the step

Not a specific error but when I try to run the code, I get this, “Sorry, your code does not pass. Keep trying.” Not sure if this is a glitch in the code checker. I followed the instruction and did exactly what it has asked for.

sure, let me reset and redo it again.

It worked, thank you very much for your help!