Javascript is a multi-paradigm programming language that allows writing code in different styles. In this article, I'd like to demonstrate how one of such simple techniques can make our code better. The goal is to improve two very important metrics of clean code: re-usability and readability. The getValidationErrors function is not too bad.

7m read timeFrom dev.to
Post cover image
Table of contents
Just make it work firstObvious refactoringCurrying to make it elegantBonus: function as a language first-class objectCode examplesConclusion

Sort: