Search posts, tags, users, and pages
Phillippe Santana
CTO at INA
Have you ever heard of Defensive Programming and the Fail-Fast system design? These are guidelines which tell us to always validate a method's input. Something like this: function sayHi(firstName, lastName) { if (!firstName?.length) throw new E...
The newer and better version of the guard clauses is now available as an NPM package. Go get it at @phillcode/guard, install with npm i @phillcode/guard or inspect the source code.
npm i @phillcode/guard
Phillippe Santana
CTO at INA
The newer and better version of the guard clauses is now available as an NPM package. Go get it at @phillcode/guard, install with
npm i @phillcode/guardor inspect the source code.