Learn Introductory JavaScript by Building a Pyramid Generator - Step 21

Tell us what’s happening:

Ive tried multiple codes but none of them work

first code
let rows = [“Naomi”, “Quincy”, “CamperChan”]
rows[2] = 10;
console.log(rows)

second code
let rows = [“Naomi”, “Quincy”, “CamperChan”]
rows[3] = 10;
console.log(rows[3])

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[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/129.0.0.0 Safari/537.36 Edg/129.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 21

Welcome to the forum @dennisleyva8

You can only declare a variable using the let keyword once.

Please remove the second declaration.

The second console log needs to print the entire array.

Then print the rows array to your console.

Happy coding

Am stock here, can someone help?

In your for...of loop, use the addition operator to concatenate the row value to the result value.

please open your own topic if the existing topics were not helping you.
Click the Help button to do that and fill out the question template

1 Like

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