Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Called if a parameter is missing and
- * the default value is evaluated.
- */
- function mandatory() {
- throw new Error('Missing parameter');
- }
- function foo(mustBeProvided = mandatory()) {
- return mustBeProvided;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement