'destructure a parameter and keep reference to it too [duplicate]
Is there a way in ES6 to destructure a parameter and reference it by name as well?
myfunction(myparam) {
const {myprop} = myparam;
...
}
Can this be done in a single line in the function parameter list? Something similar to Haskell's @ in pattern matching.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
