ASI Issues


haha

What's ASI?


https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#automatic_semicolon_insertion
oh i read that so it isn't a bug?
oh wait i didn't say that its a bug

That's what you deserve for programming in languages with semicolons. :~P

What's the problem?
functionReturningOtherFunction(...)( ...)
is quite an obvious JS construct.

So the error message means that addEventListener() doesn't return a function to be called. So there is no way to call
addEventListener(...)( function animate(...))

As the function "animate()" is not anonymous so there is no benefit in IIFE. This way it should works as expected with ASI.

addEventListener(...)
function animate(){....}
animate()

yeah yeah
also the annoying ohnoes tries to bug me with "you cant end a line with =" everytime i do something like this:

var foo=
(function(bazzes){bars(bazzes);bloops("garplies")});

i have my semicolons correct,no ambiguity(unless you dont read the second line and think:"hmm...what is foo eq too?"),no errors!!!it looks like ohnoes wants me to do this:

var foo=(function(bazzes){bars(bazzes);bloops("garplies")});

or

var foo=(
function(bazzes){bars(bazzes);bloops("garplies")});

Solution: always use semicolons.
Also, can you talk with better grammar and spelling?

Okay.
I'm just too lazy in the past 5 days.

I think you talked like that before the last 5 days...

Oh.

I think English is not his first language. If I correctly recall, he's Chinese.

:expressionless:

"Syntactic sugar leads to cancer of the semicolon." --Alan Perlis

I don't think the semicolon is that bad, other than me sometimes forgetting to put it at the end.

You and everyone else, that's part of the problem with it.

But it's not just semicolons; Perlis chose to mention them for the sake of the pun. The very worst thing about C-and-its-progeny syntax is = vs. == (vs. === in the case of Javascript, a self-parody of taking bad syntax to an extreme). With 20-odd levels of precedence in second place.