The function is actually anonymous functions in variables?

The function is actually anonymous functions in variables?

var func = function() {
//
}


The very same that

function func () {
//
}


Only the first is a Function Expression
and the second function declaration.

In other languages, too, right? functions can write to variables, returned from functions, passed as a parameter to a function without calling?
July 2nd 19 at 17:40
3 answers
July 2nd 19 at 17:44
declaration vs expression

functionOne is merely a variable that has an anonymous function assigned to it, whereas functionTwo is actually a named function. Call .toString() on both to see the difference. This is significant in some cases where you want to get the name of a function programmatically
July 2nd 19 at 17:46
In other languages, too, right? functions can write to variables, returned from functions, passed as a parameter to a function without calling?

No, not the same. For each language, all made at its own - as it was invented by the developer. There is a family of languages where something can be the same, may be different.

Find more questions by tags JavaScript