JavaScript Function With Parameter

 <!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>
    <script>

        // function sum() {
        //     let a = 40;
        //     let b = 60;
        //     let c= a+b;
        //     console.log(c);
        // }
        // sum();

         function sum(a, b) {  // Function Parameters
            let c= a+b;
            console.log(c);
        }
        sum(40,40); // Function Arguments

        sum(80, 0);
        sum(40, 50);
        sum(30, 6);




    </script>
</body>

</html>

Comments

Popular posts from this blog

JavaScript While Loop

Javascript Array Concat and Join Method

Key Frames Slider