Coggle requires JavaScript to display documents.
let funcExpr = function(num) { console.log(num * num); } funcExpr(2);
> 4
let funcExpr = function(num) { console.log(num * num); }(2);
> Uncaught SyntaxError: Function statements require a function name
function(num) { console.log(num * num); }(2);
function
function functionDecl(num) { console.log(num * num); };
(function(num) { console.log(num * num); })(2);
(function(num) { console.log(num * num); }(2));