22 July 2021

Default parameters in javascript

function print(a = 100) {
console.log(a);
}
print();
print(200);

Output:

100

200            

Github link : https://github.com/adi501/JavaScriptExamples.git






No comments:

Post a Comment