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 <nhcarrigan@gmail.com>

Co-authored-by: Nicholas Carrigan <nhcarrigan@gmail.com>
pull/39689/head
Walter Palagi 2020-09-25 01:14:44 +02:00 committed by GitHub
parent 9d2e89984c
commit 104a8068e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ Copy all contents of <code>arr1</code> into another array <code>arr2</code> usin
```yml
tests:
- text: <code>arr2</code> should be correct copy of <code>arr1</code>.
testString: assert(arr2.every((v, i) => v === arr1[i]));
testString: assert(arr2.every((v, i) => v === arr1[i]) && arr2.length);
- text: <code>...</code> spread operator should be used to duplicate <code>arr1</code>.
testString: assert(code.match(/Array\(\s*\.\.\.arr1\s*\)|\[\s*\.\.\.arr1\s*\]/));
- text: <code>arr2</code> should remain unchanged when <code>arr1</code> is changed.