Learn Introductory JavaScript by Building a Pyramid Generator - Step 19

Tell us what’s happening:

who can help me with step 19 of java script
it asks me to make an array with bracklet with first value for the rows in console.log
tnx guys

Your code so far


// User Editable Region

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


// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 19

you can’t assign to a function call, delete the assignment operator and everything after it

after that, delete "Noami", instead write rows and then use bracket notation to get the right element feom the array

  • You are asked to console.log the first element in the array.

  • rows is the array.

  • The first element in an array is at index 0.

console.log(someArray[someIndex]);

what is assignment operator?

hi
Ive deleted “Noami” instead i put rows with value in bracket but it still didn’t work
what i wrote was that : console.log(rows)=[1]
but it wasn’t the answer

Tell us what’s happening:

hi guys
can you plz help me with 19 step:
{You can access the value using bracket notation, such as array[0].
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)=[0];


// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 19

First of all, to log anything to the console, you put it inside the parentheses ():

console.log(_put_it_here);

Secondly, as the instruction said:

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

It’s array[0], there are no =.

hi bro
as you said
first of all i put my rows in parentheses . second i ad array before my bracket like this but it s still not pass
this is what ive typed:
console.log(rows) = array[0]

hi guys
who can help me with step 19
it just become tricky to solve
i try many ways but it still no solution

First of all, array[0] is just an example.

The instruction said:

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].

For example, we have an array named letter:

let letter = ["a", "b", "c", "d"];

Now we want to get the letter "a", how can we do that?
The letter "a" is the first value in the array, so its index is : 0.
So, to get the letter "a" we use: letter[0].
If we want the letter "c", we use: letter[2], because its index is: 2


Now, the instruction gave us an array of names:

let rows = ["Naomi", "Quincy", "CamperChan"];

and asked us to:

Use console.log and bracket notation to print the first value in your rows array.

So:

  • What’s the first value of the row array? (you can use the example above as a reference)
  • How can we print out that value using console.log()?

Remember, the syntax of console.log() is:

console.log(_put_what_you_want_to_print_here_);
1 Like

what about deleting the assignment operator and everything after it?

console.log(rows[0])=
tnx i got the answer

you still need to delete the assignment operator =

1 Like

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