From 88a5d46ccbd07efb155ddb912e38cd82b7f43bac Mon Sep 17 00:00:00 2001 From: lasjorg <28780271+lasjorg@users.noreply.github.com> Date: Tue, 19 Mar 2019 16:39:44 +0100 Subject: [PATCH] fix(challenge): add support for IIFE arrow function (#35573) * fix(challenge): add support for IIFE arrow function * fix(challenge): update regex --- ...he-immediately-invoked-function-expression-iife.english.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-immediately-invoked-function-expression-iife.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-immediately-invoked-function-expression-iife.english.md index 53d3ba7b0a..bc49ee49a9 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-immediately-invoked-function-expression-iife.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-immediately-invoked-function-expression-iife.english.md @@ -22,9 +22,9 @@ Rewrite the function makeNest and remove its call so instead it's a ```yml tests: - text: The function should be anonymous. - testString: assert(/\(\s*?function\s*?\(\s*?\)\s*?{/.test(code), 'The function should be anonymous.'); + testString: assert(/\((function|\(\))(=>|\(\)){/.test(code.replace(/\s/g, ""))); - text: Your function should have parentheses at the end of the expression to call it immediately. - testString: assert(/}\s*?\)\s*?\(\s*?\)/.test(code), 'Your function should have parentheses at the end of the expression to call it immediately.'); + testString: assert(/}\)\(\)/.test(code.replace(/\s/g, ""))); ```