Tell us what’s happening:
Step 21
Arrays are special in that they are considered mutable. This means you can change the value at an index directly.
For example, this code would assign the number 25 to the second element in the array:
Example Code
let array = [1, 2, 3];
array[1] = 25;
console.log(array); // prints [1, 25, 3]
Update the third element of your rows array to be the number 10. Then print the rows array to your console.
My answer is :
rows[2] = 10;
console.log(rows);
but this is not working. Please help!
Your code so far
let character = 'Hello';
let count = 8;
let rows = ["Naomi", "Quincy", "CamperChan"];
// User Editable Region
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/127.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 21