we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "javascript skip default parameter"
Edoardo
26 Nov 2019
1function myfunc(x,y=2,z=6){
2  console.log(x*y);
3  console.log(z);
4}
5myfunc(5) //Output: 10 6
6myfunc(5,4,2) //Output: 20 2
7myfunc(5,undefined,17) //Output 10 17