SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //ES6
  2. function f (a, b = 10, c = 20) {
  3.     return x + y + z
  4. }
  5. f(5) === 35
  6.  
  7. //ES5
  8. function f (a, b, c) {
  9.     if (b === undefined)
  10.         y = 10;
  11.     if (c === undefined)
  12.         c = 20;
  13.     return x + y + z;
  14. };
  15. f(1) === 35;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top