
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
What is the use of return statement inside a function in JavaScript?
The “return” statement in JavaScript mentions a value, which you like to return. Inside a function, the value is returned to the function caller.
Example
You can try to run the following code to implement return statement inside a function
<html> <body> <script> function multiply(num1, num2) { return num1 * num2; } var result = multiply(5, 10); document.write("Multiplication: "+result); </script> </body> </html>
- Related Articles
- What is the use of apply() function in JavaScript?
- What is the use of Math.imul( ) Function in JavaScript?
- What is the use of Math.hypot() function in JavaScript?
- What is the use of JavaScript eval function?
- What is the use of ()(parenthesis) brackets in accessing a function in JavaScript?
- How to use the return statement in C#?
- Can we have a return statement in a JavaScript switch statement?
- Why would you use the return statement in Python?
- What is the use of import statement in Python?
- What is the use of "assert" statement in Python?
- What is the use of ‘Using’ statement in C#?
- What is the use of yield return in C#?
- What is the use of the WITH statement in Python?
- How to use a return statement in lambda expression in Java?
- How to call a Java function inside JavaScript Function?

Advertisements