Return statement in JavaScript

 Return statement in JavaScript

In this article we are goanna to see about Return statement in JavaScript and where we use these. which is most important when you are going to start your career in JavaScript. Please read and enjoy this article if you want to give any feedback about your experience, we welcome.




Return statement may be return any type data, including arrays and objects.

Syntax:

function function_name(para1, para2, …..){
Block of statement;
return (expression);
}
function_name(args1, args2, args3,….);

Example:

function myfunction(a, b){
        return(a+b); or
return a + b;
    }

var x = myfunction(4, 3);
Document.write(x);



Share:

0 comments

Please leave your comments...... Thanks