Created
August 2, 2016 23:42
-
-
Save anonymous/545ee17f40f2228a11f54809d37697b0 to your computer and use it in GitHub Desktop.
anon functions 1 // source http://jsbin.com/someji
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>anon functions 1</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
var blastOff = function(destination) { | |
console.log("Blasting off! Headed to: " + destination); | |
}; | |
var stopIgnition = function() { | |
console.log("we have a problem"); | |
}; | |
function launchRocket(rocketName, blastOffCallback) { | |
console.log("Launching " + rocketName); | |
console.log("3... 2... 1..."); | |
blastOffCallback('Mars'); | |
} | |
launchRocket("Viking", blastOff); | |
launchRocket("Viking", stopIgnition); | |
// => Launching Viking | |
// => 3... 2... 1... | |
// => Blasting off! | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
var blastOff = function(destination) { | |
console.log("Blasting off! Headed to: " + destination); | |
}; | |
var stopIgnition = function() { | |
console.log("we have a problem"); | |
}; | |
function launchRocket(rocketName, blastOffCallback) { | |
console.log("Launching " + rocketName); | |
console.log("3... 2... 1..."); | |
blastOffCallback('Mars'); | |
} | |
launchRocket("Viking", blastOff); | |
launchRocket("Viking", stopIgnition); | |
// => Launching Viking | |
// => 3... 2... 1... | |
// => Blasting off!</script></body> | |
</html> |
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
var blastOff = function(destination) { | |
console.log("Blasting off! Headed to: " + destination); | |
}; | |
var stopIgnition = function() { | |
console.log("we have a problem"); | |
}; | |
function launchRocket(rocketName, blastOffCallback) { | |
console.log("Launching " + rocketName); | |
console.log("3... 2... 1..."); | |
blastOffCallback('Mars'); | |
} | |
launchRocket("Viking", blastOff); | |
launchRocket("Viking", stopIgnition); | |
// => Launching Viking | |
// => 3... 2... 1... | |
// => Blasting off! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment