Arrow 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: Arrow 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 anonymous function that displays a short message as an arrow function. Verify that the arrow function is not hoisted by calling the function before creating it.

Exercise 9.2: Joining two strings

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

Exercise 9.3: Pass an argument when calling a function

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

Exercise 9.4: Return a value from a called function

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

Exercise 9.5: Create an immediately invoked function

Copy the function in exercise 10-1, rename it, and re-write it as an immediately invoked arrow function.

See solution ->