Created
November 16, 2017 19:13
-
-
Save KinoAR/9d53b91a1f065d097cb9e224675136d2 to your computer and use it in GitHub Desktop.
A code example to demonstrate the power of regular functions.
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
//Hoisting Example | |
const a = test(); //Hoisted Function Execution | |
const b = new test(); | |
console.log("Ran before the function is defined", a); //Ran before the function is dined 3 | |
console.log(b) //test{} | |
function test() { | |
return 3; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment