Learn Introductory JavaScript by Building a Pyramid Generator - Step 20

Tell us what’s happening:

I am not sure why this is the wrong answer. It even prints out Naomi. I have searched online and read other questions posted here, but I am not understanding why the answer would include the second row when Naomi is at index 0. Thank you!

Note: I have also tried removing the rows[0]; line and still no luck!

let character = ‘Hello’;
let count = 8;
let rows = [“Naomi”, “Quincy”, “CamperChan”];
rows[0];
console.log(rows[0]);

Your code so far


// User Editable Region

let character = 'Hello';
let count = 8;
let rows = ["Naomi", "Quincy", "CamperChan"];
rows[0];
console.log(rows[0]);

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 20

What’s with the extra rows[0]? I think that may be your problem.

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