Skip to content

Commit 6da4823

Browse files
author
Ricardo Bin
committed
An alternative method with less parentheses
1 parent c4f5158 commit 6da4823

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

function-patterns/immediate-functions.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@
1010
Description: syntax that enables function execution as soon as it is defined
1111
*/
1212

13+
(function () {
14+
console.log('watch out!');
15+
}());
16+
17+
//alternative with less parentheses
1318
!function () {
1419
console.log('watch out!');
1520
}();
1621

22+
1723
// reference
1824
// http://www.jspatterns.com/
1925
// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate
2026
</script>
2127
</body>
22-
</html>
28+
</html>

0 commit comments

Comments
 (0)