Advertisement
Guest User

Querry1

a guest
Jul 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * Programming Quiz: Using Default Function Parameters (2-2)
  3.  */
  4.  
  5. function buildHouse({floors= 1, color= 'red', walls= 'brick'} = {}){
  6.     return `Your house has ${floors} floors and ${color} ${walls} walls.`;
  7. }
  8.  
  9.  
  10. console.log(buildHouse()); // Your house has 1 floor(s) with red brick walls.
  11. console.log(buildHouse({})); // Your house has 1 floor(s) with red brick walls.
  12. 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