Last active
August 29, 2015 14:17
-
-
Save cgrinaldi/0bc8166f9f0b71393382 to your computer and use it in GitHub Desktop.
A simple example of hosting with a function declaration
This file contains 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
sayHello(); // logs 'Hello, world!' | |
function sayHello() { | |
console.log('Hello, world!'); | |
} | |
This file contains 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 has been hoisted to top of enclosing scope | |
function sayHello() { | |
console.log('Hello, world!'); | |
} | |
sayHello(); // logs 'Hello, world!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment