JavaScript Design Patterns
Function Argument Patterns
function myfunc(a,b,c) {
return a+b+c;
}
function myfunc(a,b,c) {
return a+b+c;
}
- Like all variables in JavaScript arguments are untyped
- Unspecified arguments become undefined.
- console.log(myfunc(1,2,3));
- console.log(myfunc(1,2,3,4));
- console.log(myfunc(1,2));
No comments:
Post a Comment