# Learn Introductory JavaScript by Building a Pyramid Generator - Step 21

**URL:** <https://forum.freecodecamp.org/t/learn-introductory-javascript-by-building-a-pyramid-generator-step-21/718788>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [November 1, 2024, 9:06pm UTC](https://forum.freecodecamp.org/t/learn-introductory-javascript-by-building-a-pyramid-generator-step-21/718788 "2024-11-01T21:06:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dennis-code153](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dennis-code153/32/365256_2.png) [@Dennis-code153](https://forum.freecodecamp.org/u/Dennis-code153)\
**Post date:** [November 1, 2024, 9:06pm UTC](https://forum.freecodecamp.org/t/learn-introductory-javascript-by-building-a-pyramid-generator-step-21/718788/1 "2024-11-01T21:06:39Z")

</div>

### Tell us what’s happening:

let array = [1, 2, 3];  
array[3] = 10;  
console.log(array[rows]); // prints [1, 2, 10]  
Hello. Something is wrong with my code. Please, help me.

### Your code so far

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

// User Editable Region

let array = [1, 2, 3];
array[3] = 10;
console.log(array[rows]); // prints [1, 2, 10]

// 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/128.0.0.0 Safari/537.36 OPR/114.0.0.0`

### Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 21

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-introductory-javascript-by-building-a-pyramid-generator/step-21)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![a1legalfreelance](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/a1legalfreelance/32/385700_2.png) [@a1legalfreelance](https://forum.freecodecamp.org/u/a1legalfreelance)\
**Post date:** [November 1, 2024, 9:15pm UTC](https://forum.freecodecamp.org/t/learn-introductory-javascript-by-building-a-pyramid-generator-step-21/718788/2 "2024-11-01T21:15:20Z")

</div>

Hi. You work on the code you already have, the rows array. Don’t use the example in your code.  
Note that zero based numbering is used for the index numbering , 0 is 1, 1 is 2.  
Reset the step and try again.

---

<div class="post-metadata">

**Author:** ![Dennis-code153](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dennis-code153/32/365256_2.png) [@Dennis-code153](https://forum.freecodecamp.org/u/Dennis-code153)\
**Post date:** [November 1, 2024, 11:12pm UTC](https://forum.freecodecamp.org/t/learn-introductory-javascript-by-building-a-pyramid-generator-step-21/718788/3 "2024-11-01T23:12:21Z")

</div>

Thanks, your advice has helped me get out of the maze of predicament.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [May 3, 2025, 11:12am UTC](https://forum.freecodecamp.org/t/learn-introductory-javascript-by-building-a-pyramid-generator-step-21/718788/4 "2025-05-03T11:12:36Z")

</div>

Closed on May 3, 2025, 11:12am UTC

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