From 6c82a07b2d76d7666c06c83f96b0a8d3f02aec71 Mon Sep 17 00:00:00 2001 From: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Date: Wed, 27 Mar 2019 11:29:53 -0700 Subject: [PATCH] fix: made destructuring test more flexible (#35685) --- ...-the-rest-operator-to-reassign-array-elements.english.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-operator-to-reassign-array-elements.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-operator-to-reassign-array-elements.english.md index 65b56a48b0..09ea6b60e7 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-operator-to-reassign-array-elements.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-operator-to-reassign-array-elements.english.md @@ -24,11 +24,11 @@ Use destructuring assignment with the rest operator to perform an effective arr should be [3,4,5,6,7,8,9,10] - testString: assert(arr.every((v, i) => v === i + 3) && arr.length === 8,'arr should be [3,4,5,6,7,8,9,10]'); + testString: assert(arr.every((v, i) => v === i + 3) && arr.length === 8); - text: Array.slice() should not be used. - testString: getUserInput => assert(!getUserInput('index').match(/slice/g), 'Array.slice() should not be used.'); + testString: getUserInput => assert(!getUserInput('index').match(/slice/g)); - text: Destructuring on list should be used. - testString: getUserInput => assert(getUserInput('index').match(/\s*\[\s*,\s*,\s*\.\.\.\s*arr\s*\]\s*=\s*list\s*/g), 'Destructuring on list should be used.'); + testString: assert(code.replace(/\s/g, '').match(/\[(([_$a-z]\w*)?,){1,}\.\.\.arr\]=list/i)); ```