Learn Introductory JavaScript by Building a Pyramid Generator - Step 21

Tell us what’s happening:

Hi here’s my cosole.log output which prints correctly but I have an error message "you should use barcket notation onthe row array again. It won’t let me move to the next step.

Your code so far

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

// User Editable Region

//let rows = ["Naomi", "Quincy", "CamperChan"];
rows[2] = 10;
console.log(rows[0], rows[1], rows[2]);

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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 21

you need to print (log) the array, not the single elements

Hi thanks, I’ve tried that as well: console.log(rows);

Hi, sorry, OK thats cleared the error message this time. Regards

Hi,
I have a similar error, but I am not seeing what is incorrect in my code. Here it is.

let rows = ["Naomi", "Quincy", "CamperChan"];
rows[2] = 10;
console.log(rows);

Hey @jhomme If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

1 Like