+ 1
How to write function
are these 2 codes the same: var myFunction = function () {code} as function = myFunction () {code} If so how do you write and why?
5 Respostas
+ 11
easy way to define functions,
function functionNAME ();
{
//any content
};
+ 2
Check this out. I can't explain it as well as they do in this post, hopefuly clears it up a little for you.
http://stackoverflow.com/questions/336859/javascript-function-declaration-syntax-var-fn-function-vs-function-fn
+ 1
Thx for the answer and link. Stackoverflow is always great resource. The answer to the question is little more complicated than I tought. Have to read the answers again.
+ 1
functions are 2 types some of them don't return any value and just manipulate some data, others do return value. if your function returns value u could assign that value to a variable but u can't assign that value directly to a function, u must feed your function with parameters "function('parameter/s')".😊
+ 1
use the sololearn JavaScript Tutorials! its really helpful! 👌