const L1items = [{
title:"",
L2items:[
{
title:"",
L3items:["",""]
}
]
}
let temp =new Object(_.find(L1items,(item)=>{
....
}));
//titleL2items
//
let {L2items} =new Object(_.find(L1items,(item)=>{
....
}));
//react
Environment: the latest version of react, using create-react-app scaffolding
you can use deconstruction assignments without the data returned by lodash.? But the output of the return value of lodash is the same as that of ordinary objects.-sharp-sharp-sharp
actually loadsh works, just because the logic in the find function cannot guarantee that a return value can be found (preferably a judgment first)
when you find that this kind of code that could have passed but reports an error, you have to see if the logic of the whole code is correct. no, no, no.