I have the following javascript code:
const {
tr,
selection: { $from }
} = state;
I understand that the above is a destructuring construct but I am unsure about the : { $from }
part as there are no $from
property in the selection
object (see screenshot)...
There is no tr
in state
either...
Can someone please explain?
edit: Actually, there is indeed a $from
property (see screenshot) but it is nested. Can someone please explain how desctructuring can fetch nested properties?