Default Parameters in es6

Remember we had to do these statements to define default parameters:

Video

Javascript

var myfunction = function (height, color, url) {
    var height = height || 50
    var color = color || 'red'
    var url = url || 'http://azat.co'
}
var myfunction = function(height = 50, color = 'red', url = 'http://azat.co') {
   console.log(height)
}
myfunction(10)
Try Your Self video

Copyright 2025 by WebiBeris.com. All Rights Reserved.