Last active
December 12, 2016 16:39
-
-
Save mahasak/c708f267a6ec0edbeaae990ab39b721b to your computer and use it in GitHub Desktop.
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
| // Global Scope | |
| var bear = "Brother Bear"; | |
| function greetTheBear() { | |
| return alert(bear); | |
| } | |
| // Function Scope (Local Scope) | |
| function greetTheBigBear() { | |
| var greet = "BearHunter"; | |
| return alert(greet); | |
| } | |
| alert(greet); //Error here !!!! | |
| // Function Scope (Nested) | |
| function hailTheHusky(huskyName) { | |
| function caplitalize() { | |
| return huskyName.toUpperCase(); | |
| } | |
| var capitalized = caplitalize(); | |
| return capitalized; | |
| } | |
| alert(hailTheHusky("HuskyBear")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment