From 7fc8b5ecbd9b7fa2c155d29dbb0bdec6e5cf6a38 Mon Sep 17 00:00:00 2001 From: Vicky Fernandez Busch <41056890+vic-fb@users.noreply.github.com> Date: Mon, 13 May 2024 18:04:48 +0200 Subject: [PATCH] fix(curriculum): replace rows[2] with rows[rows.length - 1] in step 20 of JS building a pyramid generator project (#54746) --- .../660f09a2694b59c3a10ee304.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f09a2694b59c3a10ee304.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f09a2694b59c3a10ee304.md index 986974996e1..12ab8985dcc 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f09a2694b59c3a10ee304.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f09a2694b59c3a10ee304.md @@ -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.