---
id: 660f540c2176ea5dec01306d
title: Step 118
challengeType: 1
dashedName: step-118
---

# --description--

Nice work! Experiment with different values for your `character`, `count`, and `inverted` variables.

When you are ready to move on to your next project, set `character` to `"!"`, `count` to `10`, and `inverted` to `false` to continue.

Congratulations on completing your first JavaScript project!

# --hints--

You should set `character` to `"!"`.

```js
assert.equal(character, "!");
```

You should set `count` to `10`.

```js
assert.equal(count, 10);
```

You should set `inverted` to `false`.

```js
assert.equal(inverted, false);
```

# --seed--

## --seed-contents--

```js
--fcc-editable-region--
const character = "#";
const count = 8;
const rows = [];
let inverted = true;
--fcc-editable-region--

function padRow(rowNumber, rowCount) {
  return " ".repeat(rowCount - rowNumber) + character.repeat(2 * rowNumber - 1) + " ".repeat(rowCount - rowNumber);
}

for (let i = 1; i <= count; i++) {
  if (inverted) {
    rows.unshift(padRow(i, count));
  } else {
    rows.push(padRow(i, count));
  }
}

let result = ""

for (const row of rows) {
  result = result + row + "\n";
}

console.log(result);
```

# --solutions--

```js
const character = "!";
const count = 10;
const rows = [];
let inverted = false;

function padRow(rowNumber, rowCount) {
  return " ".repeat(rowCount - rowNumber) + character.repeat(2 * rowNumber - 1) + " ".repeat(rowCount - rowNumber);
}

for (let i = 1; i <= count; i++) {
  if (inverted) {
    rows.unshift(padRow(i, count));
  } else {
    rows.push(padRow(i, count));
  }
}

let result = ""

for (const row of rows) {
  result = result + row + "\n";
}

console.log(result);
```
