- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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>
Advertisements