From 104a8068e323ac304f68eac64873bce1dc79b4b3 Mon Sep 17 00:00:00 2001 From: Walter Palagi Date: Fri, 25 Sep 2020 01:14:44 +0200 Subject: [PATCH] fix(learn): in ES6 spread operator challenge test for arr2 length > 0 (#39680) * fix(learn): in ES6 spread operator challenge test for arr2 length > 0 too Fixes #39662 * Accept correction Co-authored-by: Nicholas Carrigan Co-authored-by: Nicholas Carrigan --- ...e-the-spread-operator-to-evaluate-arrays-in-place.english.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.english.md index 82f3266191..ced4aeaf90 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.english.md @@ -43,7 +43,7 @@ Copy all contents of arr1 into another array arr2 usin ```yml tests: - text: arr2 should be correct copy of arr1. - testString: assert(arr2.every((v, i) => v === arr1[i])); + testString: assert(arr2.every((v, i) => v === arr1[i]) && arr2.length); - text: ... spread operator should be used to duplicate arr1. testString: assert(code.match(/Array\(\s*\.\.\.arr1\s*\)|\[\s*\.\.\.arr1\s*\]/)); - text: arr2 should remain unchanged when arr1 is changed.