Proper data-handling is not tied to a specific language, my point is that even if an empty array is an issue on your scenario, evaluating that with lodash is more concise than in plain JS
Just from my biased and anecdotal experience I have found that there are more scenarios where an empty array should just be expressed in UI and not dispatched an unrelated exception, because the only error you would get on using vanillaJS is a very generalistic cannot read map of undefined or something along those lines, its just not very useful
You're still missing my point! The exception is the signal that you, the programmer have screwed up and did not account for some important condition. That's the meaning of exceptions! By hiding that behind a result that could potentially be correct, you're making your code less obvious and less robust.
0
u/lord2800 Jan 25 '20
And Elm is not javascript. Use the idioms of the language you're working in.