3 types of function

PHOTO EMBED

Tue Dec 15 2020 13:58:16 GMT+0000 (UTC)

Saved by @Javkhlantugs ##javascript

//Named function 
function multiply() {
    var result = 3 * 4; 
    console.log("3 multiplied by 4 is ", result);
}
multiply()

//anonymous function 
var divided = function() {
    var result = 10 / 2; 
    console.log("10 divided by 2 is ", result)
}
divided(); 

//Immediately invoked functional expressions
(function() {
    var result = 3 + 4; 
    console.log("3 plus 4 is: ", result)
}())
content_copyCOPY