Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const myArgs = {
- name: 'Billy',
- age: 26,
- enrolled: false
- };
- const functionWithManyArgs = ({name, age, enrolled = true}) => {
- console.log('Name is: ', name);
- console.log('They are this old: ', age);
- console.log('Are they enrolled? ', enrolled);
- return true;
- };
- functionWithManyArgs(myArgs);
- /*
- "Name is: " "Billy"
- "They are this old: " 26
- "Are they enrolled? " false
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement