Learn Introductory JavaScript by Building a Pyramid Generator - Step 20

Tell us what’s happening:

i don’t know how to that.console.log(rows);
USe console.log and bracket notation to print the first value in your rows array.

Your code so far


// User Editable Region

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



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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 20

Hi there, welcome to fcc community.

What you print out is the entire rows array (["Naomi", "Quincy", "CamperChan"])

What the instruction want you to print out is the first element of the rows array (the string"Naomi").

How to access the first element of the rows array?

The instruction gave you a hint:

You can access the values inside an array using the index of the value.

An index is a number representing the position of the value in the array, starting from 0 for the first value.

You can access the value using bracket notation, such as array[0].

Hi there!

Create your own topic to the challenge step, using help button. That is appears while you attempting wrong code more than three times.

thanks for the tip :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley:

1 Like