Hi dear welcome to "CodePrime" Blog . In this post YOU are going to learn JavaScript Functions with Return Value | Javascript Tutorial | BY Codeprime. First Creat A index.html file Copy This HTML CODE and pest it one your code editor. 2ndly creat return function.js file Then Copy The JS CODE and pest it then open the index.html file with your browser.
HTML CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/return function.js"></script>
<title>javascript</title>
</head>
<body>
<!-- <h2>Javascript Tutorial</h2>
<h3>By Codeprime</h3> -->
</body>
</html>
JAVASCRIPT CODE
function exam(math,english,physic){
var sum = math + english + physic ;
return sum;
}
var total = exam(70,80,55);
document.write(total);
0 Comments