Destructuring: spelling mistake & fault console.log
DBi1512 opened this issue · comments
const rectangle = {
width: 20,
height:10,
area: 200
}
let {width, heigh, area, perimeter = 60} = rectangle;
console.log(width, height, area, perimeter) //20 10 200 60
//Lets modify the object:width to 30 and perimeter to 80
const rectangle = {
width: 30,
height:10,
area: 200,
perimeter:80
}
let {width, heigh, area, perimeter = 60} = rectangle;
console.log(width, height, area, perimeter) //20 10 200 80
Mistake:
Spelling mistake: heigh
Last console.log should be //30 10 200 80