--- title: Helper Functions | Algorithms and Data Structures in TypeScript and JavaScript description: This page contains a list of helper functions we use, either to improve readability or to reduce rewriting some functions over and over again. --- ## Helper Functions This page contains a list of helper generic helper functions we use either to improve readability or to reduce rewriting some functions over and over again. The goal is to make them very specific (do one thing and do it well) so they can be combined and composed easily with other functions. ### add(x, y) ```{literalinclude} /../src/algds/ts/lib/add.test.ts :language: typescript ``` ```{literalinclude} /../src/algds/ts/lib/add.ts :language: typescript ``` ### isEven(n) ```{literalinclude} /../src/algds/ts/lib/isEven.test.ts :language: typescript ``` ```{literalinclude} /../src/algds/ts/lib/add.ts :language: typescript ```