Last active
August 3, 2016 13:18
-
-
Save jamigibbs/5a107b8e8ce854230a7c0dd5dc3f2442 to your computer and use it in GitHub Desktop.
Use Strict Examples
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
// Whole-script strict mode syntax | |
(function($) { | |
'use strict'; | |
// Author code below | |
function hello(){ | |
return "Hi! I'm in strict mode!"; | |
} | |
// Author code below | |
function helloAgain(){ | |
return "Hi! I'm also in strict mode!"; | |
} | |
})(jQuery); | |
// Function-level strict mode syntax | |
function strict(){ | |
'use strict'; | |
return "Hi! I'm a strict mode function!"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment