Search This Blog

2023/07/25

Closure triple multiplication

 


function mul(x){
return function(y){
return function(z){
return x*y*z;
}
}
}

var res = mul(2)(3)(4)

console.log(res)

output:
24

No comments:

Post a Comment