Skip to main content

this sounds like a javascript syntax bug:

a named function could be a statement however, aan anonymous function just consider it as an expression.

Pro: you can do function() { ... }()function() { ... }()

Con: you cannot do function() { ... }function() { ... }

But why people would want to define a anonymous function without invoking it? So the con is not really a concern.

this sounds like a javascript syntax bug:

a named function could be a statement however, a anonymous function just consider it as an expression.

Pro: you can do function() { ... }()

Con: you cannot do function() { ... }

But why people want to define a anonymous function without invoking it? So the con is not really a concern.

this sounds like a javascript syntax bug:

a named function could be a statement however, an anonymous function just consider it as an expression.

Pro: you can do function() { ... }()

Con: you cannot do function() { ... }

But why people would want to define a anonymous function without invoking it? So the con is not really a concern.

Source Link

this sounds like a javascript syntax bug:

a named function could be a statement however, a anonymous function just consider it as an expression.

Pro: you can do function() { ... }()

Con: you cannot do function() { ... }

But why people want to define a anonymous function without invoking it? So the con is not really a concern.