fix(curriculum): replace rows[2] with rows[rows.length - 1] in step 20 of JS building a pyramid generator project (#54746)

This commit is contained in:
Vicky Fernandez Busch
2024-05-13 18:04:48 +02:00
committed by GitHub
parent 86860e85a5
commit 7fc8b5ecbd

View File

@@ -7,7 +7,7 @@ dashedName: step-20
# --description--
For now, remove your first console log and your `rows[2]` assignment. Leave the second `rows` log statement for later.
For now, remove your first console log and your `rows[rows.length - 1]` assignment. Leave the second `rows` log statement for later.
# --hints--
@@ -17,10 +17,10 @@ You should remove your `console.log(rows[0])` statement.
assert.notMatch(code, /console\.log\(\s*rows\[\s*0\s*\]\s*\)/);
```
You should remove your `rows[2]` reassignment.
You should remove your `rows[rows.length - 1]` reassignment.
```js
assert.notMatch(code, /rows\[2\]/);
assert.notMatch(code, /rows\[\s*rows\.length\s*-\s*1\s*\]/);
```
You should not remove your `console.log(rows)` statement.