Timeline for conditionally deconstruct object (javascript) [closed]
Current License: CC BY-SA 4.0
Post Revisions
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 13, 2018 at 10:08 | vote | accept | xx yy | ||
| Dec 12, 2018 at 16:42 | history | closed |
Andy Roman Pokrovskij Patrick lmiguelvargasf Vickel |
Needs details or clarity | |
| Dec 12, 2018 at 15:20 | comment | added | Estus Flask |
Please, provide your real code instead of abstractions. Why should obj be defined in function scope? As it was said, it's unclear what you're trying to achieve.
|
|
| Dec 12, 2018 at 15:11 | comment | added | xx yy | the function is just simplified, and it is very clear that it accebts an object, but if no argument passed it will use a default one | |
| Dec 12, 2018 at 14:35 | review | Close votes | |||
| Dec 12, 2018 at 16:42 | |||||
| Dec 12, 2018 at 14:18 | comment | added | Andy |
It's not clear from your example what you're trying to achieve. You're creating an object only to deconstruct it again. What's the point? Why not create an object with those variables and you wouldn't have to deconstruct it. What are you returning from the function? The object, x? You should really provide your quesiton with more details.
|
|
| Dec 12, 2018 at 14:14 | answer | added | Osama | timeline score: -1 | |
| Dec 12, 2018 at 14:09 | answer | added | shawon191 | timeline score: 0 | |
| Dec 12, 2018 at 13:59 | comment | added | Hardik Modha | developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/… | |
| Dec 12, 2018 at 13:56 | answer | added | Sergej | timeline score: -1 | |
| Dec 12, 2018 at 13:53 | history | asked | xx yy | CC BY-SA 4.0 |