daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest Oct 18th, 2018 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function test3(name, age, height) {
  2.   console.log(name + " is " + age + " years old and " + height + " inches tall");
  3. }
  4.  
  5. function test1(name) {
  6.   console.log(name + " is a wizard");
  7. }
  8.  
  9. function test() {
  10.   switch (arguments.length) {
  11.     case 3: return test3(arguments[0], arguments[1], arguments[2]);
  12.     case 1: return test1(arguments[0]);
  13.     default: throw new Error("invalid argument count");
  14.   }
  15. }
  16.  
  17. test("bryce");
  18. test("bryce", 25, (5*12)+11);
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