# Build a Pyramid Generator - 2nd test not clear?

**URL:** <https://forum.freecodecamp.org/t/build-a-pyramid-generator-2nd-test-not-clear/780124>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [February 24, 2026, 11:53pm UTC](https://forum.freecodecamp.org/t/build-a-pyramid-generator-2nd-test-not-clear/780124 "2026-02-24T23:53:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahoue](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mahoue/32/379144_2.png) [@Mahoue](https://forum.freecodecamp.org/u/Mahoue)\
**Post date:** [February 24, 2026, 11:53pm UTC](https://forum.freecodecamp.org/t/build-a-pyramid-generator-2nd-test-not-clear/780124/1 "2026-02-24T23:53:22Z")

</div>

### Tell us what’s happening:

I don’t understand how it is possible to check the 1, 3, 4 steps but not the 2 step one !

What is going on ?

### Your code so far

```js
function pyramid(char, rows, bool){
  let string = "";
  let space = " ";
  let breaker = "\n"
  let charNum = rows*2-1;
  if(bool === true){ 
    for(let i = 0; i<rows; i++){
      if(i !== rows){
        string += "\n"+(space.repeat(i)) +char.repeat(charNum-(i*2));
      }
    }
    string+= breaker
    return string;
  }

  if(bool === false){
    for(let i = rows; i>0; i--){
      if(i !== rows+1){
        string += "\n"+(space.repeat(i-1)) +char.repeat(charNum-((i-1)*2));
      }
    }
    string+= breaker
    return string;
  }
}

let result = pyramid("p",4,false);

console.log("Result :");
console.log(result);

```

### Your browser information:

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

### Challenge Information:

Build a Pyramid Generator - Build a Pyramid Generator

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-v9/lab-pyramid-generator/lab-pyramid-generator)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![Mahoue](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mahoue/32/379144_2.png) [@Mahoue](https://forum.freecodecamp.org/u/Mahoue)\
**Post date:** [February 25, 2026, 2:26am UTC](https://forum.freecodecamp.org/t/build-a-pyramid-generator-2nd-test-not-clear/780124/2 "2026-02-25T02:26:48Z")

</div>

I am having the same issue withing the TitleCase converter (where steps 2 doesn’t work even tho I only pass one argument)

```auto
function titleCase(str){
  let result = "";
  let array = [];
  array = str.toLowerCase().split(" ");
  for(let word of array){
    result += word[0].toUpperCase()+word.slice(1, word.length)+" ";
  }
  result = result.trimEnd();
  return result;
}

let result = titleCase("MIOU miou MIou Miou");

console.log(result);

```

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [February 25, 2026, 8:27am UTC](https://forum.freecodecamp.org/t/build-a-pyramid-generator-2nd-test-not-clear/780124/3 "2026-02-25T08:27:32Z")

</div>

Your solution works from my end. Please try one of the following steps to move forward.

Click on the “Restart Step” button and force a refresh of your page with CTRL + F5 then try to paste the code in again.

or - Try the step in incognito or private mode.

or - Disable any/all extensions that interface with the freeCodeCamp website (such as Dark Mode, Ad Blockers, or Spellcheckers), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

or - Ensure your browser is up-to-date or try a different browser.

I hope one of these will work for you.

---

<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:** [March 25, 2026, 8:27am UTC](https://forum.freecodecamp.org/t/build-a-pyramid-generator-2nd-test-not-clear/780124/4 "2026-03-25T08:27:49Z")

</div>

Closed on March 25, 2026, 8:27am UTC

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