DEV Community

Cover image for JavaScript Function
aasif247
aasif247

Posted on

JavaScript Function

Function Declarations

function myFunction(a,b){
    return a*b;
} 
console.log(myFunction(3,4)); 

Enter fullscreen mode Exit fullscreen mode

function myFunction(a,b){
return a*b;
}

Here this portion is a declaration that's why don't use any semi colon(;)

console.log(myFunction(3,4));

This portion is function execution ( an statement) , that's why we are using semi colon(;)

Oldest comments (0)