Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function foo({from = 0, to = 100, foo = 'bar', optional} = {}) {
- console.log(from, to, foo, optional);
- }
- foo();
- // 0, 100, "bar", undefined
- foo({from: 99});
- // 99, 100, "bar", undefined
- foo({optional: 'awwyis'});
- // 0, 100, "bar"; "awwyis"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement