Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Page Title</title>
- </head>
- <body>
- <h1>IIFE example</h1>
- </body>
- <script>
- (function () {
- var foo = 'Hello';
- function greet(){
- console.log(foo);
- }
- greet();
- })();
- </script>
- </html>
Add Comment
Please, Sign In to add comment