|
|
|
|
|
by ludwigvan
5289 days ago
|
|
I have to disagree. Part of the reason is that it teaches the concept of anonymous functions. The main reason, though, is the anonymous function case makes it more apparent that the function is an object. Separating the RHS from the LHS is significant. The right side creates the object, the left side binds it to the reference. Much like `var a = 3`. It is the assignment that makes it interesting for people that I teach JavaScript. Consider the following, can you do that in a less function-oriented language like Java easily? var getData = function () {};
var mygetdata = getdata;
getData("foo")
mygetData("foo")
|
|