Posted By

TioSolid on 08/10/10


Tagged

javascript


Versions (?)

Default value for javascript function


 / Published in: JavaScript
 

  1. function foo(a, b)
  2. {
  3. a = typeof(a) != 'undefined' ? a : 42;
  4. b = typeof(b) != 'undefined' ? b : 'default_b';
  5. //...
  6. }

Report this snippet  

You need to login to post a comment.