Wednesday 9 February 2022

Nodejs - Arrow Functions

Arrorw Functions :
    
        -> Its a shortest way to define functions.

             EXAMPLE:    
            
            Without Parameter

                    var kamal =()=>{console.log("Its a arrow functions")}
                   
                     kamal()            ///call function

            With Parameter

                    var kamal =(a)=>{console.log("value of a is :"+a)}
                    
                    kamal(5)          ///call function

            With Multiple Parameter

                    var kamal =(a,b)=>{
                                
                    var  c=a+b
                    console.log("value of c is :"+c)}
                    
                    kamal(5,5)          ///call function

OUTPUT- value of c is :10

No comments:

Post a Comment

Kotlin - Observer

 Rxjava -  Observer - Based on data view willl render (react) karega. trotling -> making stream for execution (Means clicks event fire kr...