Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Programming Quiz: Using Default Function Parameters (2-2)
- */
- function buildHouse({floors= 1, color= 'red', walls= 'brick'} = {}){
- return `Your house has ${floors} floors and ${color} ${walls} walls.`;
- }
- console.log(buildHouse()); // Your house has 1 floor(s) with red brick walls.
- console.log(buildHouse({})); // Your house has 1 floor(s) with red brick walls.
- console.log(buildHouse({floors: 3, color: 'yellow'})); // Your house has 3 floor(s) with yellow brick walls.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement