Created
October 14, 2017 15:31
-
-
Save Fouzyyyy/4e545857457044f55d76367bb25ddc05 to your computer and use it in GitHub Desktop.
Arrow functions as callable parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function executeThis(callableParameter) { | |
callableParameter(); | |
alert('We are done here :)'); | |
} | |
executeThis(() => { | |
alert('Hi there! I am an arrow function passed as an argument, ihaaaaaaa!'); | |
}); | |
// The messages display order will be like so: | |
// 1- Hi there! I am an arrow function passed as an argument, ihaaaaaaa! | |
// 2- We are done here :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment