Guest User

Untitled

a guest
Oct 18th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  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);
Add Comment
Please, Sign In to add comment