DEV Community

Discussion on: Keeping your code clean by sweeping out "if" statements

Collapse
 
pacozaa profile image
pacozaa

Hi Tomaz! Great article. I am recently using the pattern that keep all errors message object in big chunk of array. Then used a function to search(array.find) to match the "key" property then return matched message.

I find that implementation is easy and fast to scale since spread function could have expand more chunk of another chunk of array.

What do you think of that?

I am always looking for a way to implement "error handling" faster and better.