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 325a0f8825..476119e9b4 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 @@ -30,9 +30,9 @@ Rewrite the function makeNest and remove its call so instead it's a ```yml tests: - text: The function should be anonymous. - testString: assert(/\((function|\(\))(=>|\(\)){/.test(code.replace(/\s/g, ""))); + 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(/}\)\(\)/.test(code.replace(/\s/g, ""))); + testString: assert(/}?\)\(\)$|}\(\)\)$/.test(code.replace(/[\s;]/g, ""))); ``` @@ -67,4 +67,22 @@ makeNest(); })(); ``` +```js +(function () { + console.log("A cozy nest is ready"); +}()); +``` + +```js +(() => { + console.log("A cozy nest is ready"); +})(); +``` + +```js +(() => + console.log("A cozy nest is ready") +)(); +``` +