I want to structure object in es6 but not getting results.
let animal ={
data:{
typee:{
title: "Cow",
legs:4
}
}
}
let {data:{typee:{title,legs}}}=animal;
now console.log(data) giving output Error: data is not defined.
What I am doing wrong ?
let { data } = animal;?titleandlegs,dataandtypee, or all four?