forked from chuanxshi/javascript-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimmediate-functions.html
More file actions
28 lines (24 loc) · 566 Bytes
/
Copy pathimmediate-functions.html
File metadata and controls
28 lines (24 loc) · 566 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!doctype html>
<html lang="en">
<head>
<title>JavaScript Patterns</title>
<meta charset="utf-8">
</head>
<body>
<script>
/* Title: Immediate functions
Description: syntax that enables function execution as soon as it is defined
*/
(function () {
console.log('watch out!');
}());
//alternative with less parentheses
!function () {
console.log('watch out!');
}();
// reference
// http://www.jspatterns.com/
// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate
</script>
</body>
</html>