2 * Function expressions as variables
5 // Anonymous function expression without body
6 var foo = function () {};
7 var fooArg = function (a, b, c) {};
9 // Named function expression without body
10 var bar = function bar () {};
11 var barArg = function barArg (a, b, c) {};
13 // Anonymous function expression with body
14 var baz = function () {
17 var bazArg = function (a, b, c) {
21 // Named function expression with body
22 var booz = function booz (a, b, c) {
25 var boozArg = function boozArg () {
30 * Function expression as arguments
33 // Named function expression with body
34 call(function test () {
37 call(x, function test () {
40 call(function test () {
44 // Named function expression with body and arguments
45 call(function testArg (a, b, c) {
48 call(x, function testArg (a, b, c) {
51 call(function testArg (a, b, c) {
55 // Named function expression without body and arguments
56 call(function test2 () {});
57 call(x, function test2 () {});
58 call(function test2 () {}, x);
60 // Named function expression without body and with arguments
61 call(function test2Arg (a, b, c) {});
62 call(x, function test2Arg (a, b, c) {});
63 call(function test2Arg (a, b, c) {}, x);
66 // Anonymous function expression with body
77 // Anonymous function expression with body and arguments
78 call(function (a, b, c) {
81 call(x, function (a, b, c) {
84 call(function (a, b, c) {
88 // Anonymous function expression without body and arguments
90 call(x, function () {});
91 call(function () {}, x);
93 // Anonymous function expression without body and with arguments
94 call(function (a, b, c) {});
95 call(x, function (a, b, c) {});
96 call(function (a, b, c) {}, x);
99 * Function expression as object methods
103 // Anonymous function expression without body
105 fooArg: function (a, b, c) {},
107 // Named function expression without body
108 bar: function bar () {},
109 barArg: function barArg (a, b, c) {},
111 // Anonymous function expression with body
115 bazArg: function (a, b, c) {
119 // Named function expression with body
120 booz: function booz (a, b, c) {
123 boozArg: function boozArg () {
129 * Function expression immediate execution
132 // Anonymous function expression without body
134 (function (a, b, c) {})();
136 // Named function expression without body
137 (function bar () {})();
138 (function barArg (a, b, c) {})();
140 // Anonymous function expression with body
144 (function (a, b, c) {
148 // Named function expression with body
149 (function booz (a, b, c) {
152 (function boozArg () {
157 // Anonymous function expression without body
159 (function (a, b, c) {}());
161 // Named function expression without body
162 (function bar () {}());
163 (function barArg (a, b, c) {}());
165 // Anonymous function expression with body
169 (function (a, b, c) {
173 // Named function expression with body
174 (function booz (a, b, c) {
177 (function boozArg () {