Skip to content

Instantly share code, notes, and snippets.

@jamigibbs
Last active August 3, 2016 13:18
Show Gist options
  • Save jamigibbs/5a107b8e8ce854230a7c0dd5dc3f2442 to your computer and use it in GitHub Desktop.
Save jamigibbs/5a107b8e8ce854230a7c0dd5dc3f2442 to your computer and use it in GitHub Desktop.
Use Strict Examples
// 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