diff --git a/README.md b/README.md index 149df336c2..a9df7a75bb 100644 --- a/README.md +++ b/README.md @@ -279,7 +279,7 @@ // immediately-invoked function expression (IIFE) (function() { console.log('Welcome to the Internet. Please follow me.'); - })(); + }()); ``` - Never declare a function in a non-function block (if, while, etc). Assign the function to a variable instead. Browsers will allow you to do it, but they all interpret it differently, which is bad news bears. @@ -775,14 +775,14 @@ // bad (function(global) { // ...stuff... - })(this); + }(this)); ``` ```javascript // good (function(global) { // ...stuff... - })(this); + }(this)); ``` @@ -891,19 +891,19 @@ (function() { var name = 'Skywalker' return name - })() + }()) // good (function() { var name = 'Skywalker'; return name; - })(); + }()); // good ;(function() { var name = 'Skywalker'; return name; - })(); + }()); ``` **[[⬆]](#TOC)**