Learn Introductory JavaScript by Building a Pyramid Generator - Step 95

const character = "#";
const count = 8;
const rows = [];
function padRow(rowNumber, rowCount) {
  return " ".repeat(rowCount - rowNumber) + character.repeat(2 * rowNumber - 1) + " ".repeat(rowCount - rowNumber);
}
let done = 0;
while (rows.length < count) {
  done++;
  rows.push(padRow(done, count));
}
let result = ""
for (const row of rows) {
  result = result + row + "\n";
}
console.log(result);

These are the instructions for this step:

Using done to track the number of rows that have been generated is functional, but you can actually clean up the logic a bit further.
Arrays have a special length property that allows you to see how many values, or elements, are in the array. You would access this property using syntax like myArray.length.
Note that rows.length in the padRow call would give you an off-by-one error, because done is incremented before the call.
Update your condition to check if rows.length is less than count.

Could someone explain what this means? why would it be off-by-one?

Note that rows.length in the padRow call would give you an off-by-one error, because done is incremented before the call

The off by one error is explained in step 46. It happens in array indexing which is zero based. If you change your condition to rows.length <= count you will see in the preview this causes an error. Rows is an array. Have a look what the loop is executing to see how this is throwing it off.