DEV Community

Discussion on: βœ”||🀒 Commit or Vomit | checks.some()

Collapse
 
ingosteinke profile image
Ingo Steinke • Edited

Thanks for the inspiring example. Although .some is a useful method, I would never commit or even write code like this, I even doubt it works (in the way I thought it was intended to).

In general, I prefer to write more explicit and verbose code rather than oversimplified stuff that might be misleading when reading to maintain and modify.

Thanks to Anner Visser for pointing out what the code actually does: less magic than I thought was intended. To make the checks run in the last line, you would have had to use validator functions in the lines above (or computed properties, unless you stick to vanilla JS), which makes the code already less elegant, less compact, and more like what I have seen in React projects.

Collapse
 
jmdejager profile image
🐀πŸ₯‡ Jasper de Jager

The code does work, it isn't a real world example though πŸ˜‰