JavaScript Function with return Value

 



JavaScript Function with return Value

<!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">
    <title>Document</title>
</head>
<body>
    <h1>JavaScript Function with return Value</h1>
    <script>
        function  userdetails(fname, lname){
            // console.log("Hello " + fname + " " + lname);

            return "Hello " + fname + " " + lname
        }
       let a = userdetails("Seema","Sharma"); // actual Value

       document.write(a);

    </script>
</body>
</html>

Comments

Popular posts from this blog

Javascript Array Concat and Join Method

JavaScript While Loop

JavaScript pop() Method