Default functions parameters
When declaring a function,
a default value can be assigned to any argument
In every case the argument will not be sent while
calling the function, the default will be assigned

    fucntion calculate(a,b = 3) {
        return a*b;
    }
    
    calculate(2,2);         
    //will return 4
    
    calculate(2);           
    //will return 6 (2 sent * 3 default)

    
back to main page