MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/node/comments/jrau9t/conditionally_call_a_function_with_optional/gbssaus/?context=3
r/node • u/wobsoriano • Nov 10 '20
126 comments sorted by
View all comments
Show parent comments
-20
This is a worse way of doing it.
11 u/threeys Nov 10 '20 Why is it worse? -6 u/OmgImAlexis Nov 10 '20 edited Nov 10 '20 It’s harder to read the intent and doesn’t add anything helpful for the few chars it saves. 4 u/burnblue Nov 10 '20 Is it still a few characters when the function is deep?.inside?.an?.object?.() 2 u/ikeif Nov 10 '20 This is when I pulled it into a project.Large JSON objects, so it was either constantly making shorthand assignments or being able to concisely do it this way.People get so hung up on an option in a toolset. It’s not for every project, but some projects, it’s a good tool.
11
Why is it worse?
-6 u/OmgImAlexis Nov 10 '20 edited Nov 10 '20 It’s harder to read the intent and doesn’t add anything helpful for the few chars it saves. 4 u/burnblue Nov 10 '20 Is it still a few characters when the function is deep?.inside?.an?.object?.() 2 u/ikeif Nov 10 '20 This is when I pulled it into a project.Large JSON objects, so it was either constantly making shorthand assignments or being able to concisely do it this way.People get so hung up on an option in a toolset. It’s not for every project, but some projects, it’s a good tool.
-6
It’s harder to read the intent and doesn’t add anything helpful for the few chars it saves.
4 u/burnblue Nov 10 '20 Is it still a few characters when the function is deep?.inside?.an?.object?.() 2 u/ikeif Nov 10 '20 This is when I pulled it into a project.Large JSON objects, so it was either constantly making shorthand assignments or being able to concisely do it this way.People get so hung up on an option in a toolset. It’s not for every project, but some projects, it’s a good tool.
4
Is it still a few characters when the function is deep?.inside?.an?.object?.()
2 u/ikeif Nov 10 '20 This is when I pulled it into a project.Large JSON objects, so it was either constantly making shorthand assignments or being able to concisely do it this way.People get so hung up on an option in a toolset. It’s not for every project, but some projects, it’s a good tool.
2
This is when I pulled it into a project.
Large JSON objects, so it was either constantly making shorthand assignments or being able to concisely do it this way.
People get so hung up on an option in a toolset. It’s not for every project, but some projects, it’s a good tool.
-20
u/OmgImAlexis Nov 10 '20
This is a worse way of doing it.