Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function test3(name, age, height) {
- console.log(name + " is " + age + " years old and " + height + " inches tall");
- }
- function test1(name) {
- console.log(name + " is a wizard");
- }
- function test() {
- switch (arguments.length) {
- case 3: return test3(arguments[0], arguments[1], arguments[2]);
- case 1: return test1(arguments[0]);
- default: throw new Error("invalid argument count");
- }
- }
- test("bryce");
- test("bryce", 25, (5*12)+11);
Add Comment
Please, Sign In to add comment