Functions In JavaScript - Advanced JavaScript Course 07

 Functions In JavaScript


Functions In JavaScript
Functions are the block of codes that are used frequently.
Once you define a function you can call by this format 

sum();

Here is the code fo the video in youtube


<script>

    // Past Time Functions in JS
    function sum(x,y) {
        console.log("the sum of your numbers are :", x + y);
        console.log("done");
    };

    // Arrow Functions In JS
    let hello = () =>{
        console.log("Hi how are you & i am fine");
    };
   


    // Program In JS
    let a = prompt("enter the value of a :");
    let b = prompt("enter the value of b :");
    let c = prompt("enter the value of c :");
    a = Number.parseInt(a);
    b = Number.parseInt(b);
    c = Number.parseInt(c);


    // Console.log (everything)
    console.log(sum(a,b));
    console.log(sum(a,b));
    console.log(sum(a,b));
    console.log(sum(a,b));
    console.log(sum(a,b));

    // Calling The Arrow Function
    hello();
   
</script>




Post a Comment

Previous Post Next Post