Functional programming (FP)¶
This grader checks whether your code uses regular loops (while, for) or not. Functional style (using map, filter, reduce, etc.) is preferred over loops.
WebCAIS promotes FP coding style. If you are going to proceed with web development, the next courses in TUNI, WebDev1 and Advanced Frontends that introduces React and Redux that use FP programming style. E.g. in Redux, state management is based on immutable states and state changes that are handled in FP manner.
First, there is an eslint extension for promoting FP coding style: https://www.npmjs.com/package/eslint-plugin-fp. Practicing FP proceeds in minor steps: map(), filter(), and reduce() exemplify FP style and the functions are applied as for loop alternatives. Check also the summary of for loop alternatives in FP cheatsheet.
The only FP rule checked is: "fp/no-loops": "error"
Exercise fails, if there are any errors in the ESLint report with FP checks. Warnings do not cause a fail but it is still a good practice to fix them too.
Submitting Your Project to Plussa
PLEASE NOTE: You should copy-paste the git@.... url, not the https://... url
A+ presents the exercise submission form here.