Arrow Function in JavaScript

Free Web development courses with real-time projects Start Now!!

Program 1

<html>
    <head>
        <script>
                   let maxnumber=(a,b) =>{
                                                        if(a>b)
                                                       alert("First number is grater")
                                                    else
                                                      alert("Second number is grater")                    

                                                         }      
                    // let factorial=n=>{
                    //                                     let f=1
                                                        
                    //                                     while(n!=0)                                   
                    //                                     {
                    //                                         f=f*n
                    //                                         n--
                    //                                     }
                    //                                     alert("Factorial is " + f)
                    //                           }

                    // let max=() =>{
                    //                               alert("Hello")
                    //                                 // if(a>b)
                    //                                 //    alert("First number is grater")
                    //                                 // else
                    //                                 //   alert("Second number is grater")
                    //                        }                          
        </script>

    </head>
 
    <body>
      <center>
       <form>
         
          <input type="button" value="Click here" onclick="maxnumber(50,290)">
       </form>
     </center>
    </body>
</html>

 

Did you know we work 24x7 to provide you best tutorials
Please encourage us - write a review on Google

courses

Leave a Reply

Your email address will not be published. Required fields are marked *