Learn Introductory JavaScript by Building a Pyramid Generator - Step 21

Tell us what’s happening:

Hi, I seem to be stuck on this step where it asks me to log my rows again or use bracket notation? Then to reassign the value. I tried a couple different solutions such as;
let rows = [“Naomi”, “Quincy”, “CamperChan”];
console.log(rows);
rows[3] = 10;
console.log(rows[3]);
Tried looking up where I went wrong but seems it’s been recently changed since the videos i’m seeing were uploaded. Appreciate the help if any in advance!

Your code so far

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

// User Editable Region

console.log(rows);
rows[3] = 10;
console.log(rows[3]);

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 21

Welcome to the forum @Chris77

Read the instructions carefully on how to access a certain element in an arrary.

Also, please remove the second console.log as the instructions did not ask for it.

Happy coding

Thanks, it turns out i missed a part in the example that made it clear. Some time away helped to make it easier to see.

1 Like