Learn Introductory JavaScript by Building a Pyramid Generator - Step 18

Tell us what’s happening:

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

It says I need a second console.log statement I believe I have one my code is above please let me know what I am missing I have been stuck here for days…

Your code so far

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

// User Editable Region

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

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 18

you don’t need the assignment twice, also you never put the assignment as argument of something else

you want to print the rows array only, without additional syntax

that is not correct my code is what you replied and that is not correct rows[2] = 10;
console.log(rows[2] = 10);

please view the screen shot I have been stuck here for a min is it freecode camp I think I am using bracket notation I cant find anything on Web3 schools

exactly, it’s not correct, you must not have the assignment in the console.log, you should have the assignment only once and that is without the console.log

rows[2] = 10;

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

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

so where is the assignment exactly ?? What would the line of code be ?

They did not provide you the answer, only a hint. Your array is titled rows and you got that right, now look at the example given and replace terms. Do not add additional syntax. :+1:

The array is defined above, so you are only adding the last two lines of code.

rows[2] = 10;

console.log(rows[2] = 10); // prints [2]

this is mt line of code should I reset ?? and replace terms ?? I am very confused was my original line of code correct ?

rows[2] = 10;

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

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

or is it this line of code originally then replace terms ??

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

Reset it… then copy the last two lines of example code.

array[1] = 25;
console.log(array);

then plug in the appropriate terms.

Don’t give up…

Did that help?

array[2] = 10;

console.log(rows);

rows[2] = 10;

console.log(rows);

I GOT IT THANK YOU SO MUCH!

We have blurred this solution (with [spoiler][/spoiler] tags) so that users who have not completed this challenge can read the discussion in this thread without giving away the solution.

you do not have a variable named array. what is the name of your array?

sounods good sorrya bout that

1 Like

You’re welcome. Keep the momentum going. :+1: