--- id: 587d7db2367417b2b2512b8b title: Understand the Immediately Invoked Function Expression (IIFE) localeTitle: Comprender la expresión de función invocada inmediatamente (IIFE) challengeType: 1 --- ## Description
Un patrón común en JavaScript es ejecutar una función tan pronto como se declara:
(function () {
  console.log("Chirp, chirp!");
})(); // this is an anonymous function expression that executes right away
// Outputs "Chirp, chirp!" immediately
Tenga en cuenta que la función no tiene nombre y no está almacenada en una variable. Los dos paréntesis () al final de la expresión de la función hacen que se ejecute o se invoque inmediatamente. Este patrón se conoce como una immediately invoked function expression o IIFE .
## Instructions
Reescriba la función makeNest y elimine su llamada, por lo que es una immediately invoked function expression forma anónima ( IIFE ).
## Tests
```yml tests: - text: La función debe ser anónima. testString: 'assert(/\(\s*?function\s*?\(\s*?\)\s*?{/.test(code), "The function should be anonymous.");' - text: Su función debe tener paréntesis al final de la expresión para llamarla inmediatamente. testString: 'assert(/}\s*?\)\s*?\(\s*?\)/.test(code), "Your function should have parentheses at the end of the expression to call it immediately.");' ```
## Challenge Seed
```js function makeNest() { console.log("A cozy nest is ready"); } makeNest(); ```
## Solution
```js (function () { console.log("A cozy nest is ready"); })(); ```