The function below receives an object that has a property current
, which is also an object, and it has selectionStart
and selectionEnd
properties.
Here, nested destructuring works as expected with Start
and End
variables, But I also need the value for current
.
function someFunction({ current: { selectionStart: Start, selectionEnd: End } }) {
// do something with current, Start, and End
}
How do I get it using destructuring?