Anonymous Functions: Exercises

Display this web page in Brave or other, lesser web browsers.

Also open the page in a code editor. VS Code, VS Code Online or Sublime Text are all are good choices.

Follow the exercises in the online Lesson: Anonymous Functions

✅  Happy coding.

Sample heading

Lorem ipsum dolor sit amet consectetur adipisicing elit. Sed aliquid, distinctio ipsa pariatur exercitationem voluptate illo accusamus in sint voluptas quia alias odit! Nesciunt expedita libero accusantium sed quibusdam magni!

Exercise 9.1: Displaying a message

Rewrite the function declaration that displays a short message as an anonymous function. Verify that the anonymous function is not hoisted by calling the function before creating it.

Exercise 9.2: Joining two strings

Rewrite the function declaration that joins the two strings as an anonymous function.

Exercise 9.3: Pass an argument when calling a function

Rewrite the function declaration that passes a number as an anonymous function.

Exercise 9.4: Return a value from a called function

Rewrite the function declaration that calls a random number generator function as an anonymous function.

Exercise 9.5: Create an immediately invoked function

Copy the function in exercise 9-1, rename it, and rewrite it as an immediately invoked anonymous function.