Functional programming in JavaScript
Vesanto, Riku (2023)
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-202305109682
https://urn.fi/URN:NBN:fi:amk-202305109682
Tiivistelmä
The aim with this thesis was to explore how functional programming could be utilized in JavaScript development and what would the benefits of doing so be. The thesis topic was chosen due to the author’s wish to write cleaner code. Functional programming seemed like it would give keys to achieving this goal and push the developer towards better coding habits.
Although JavaScript is not traditionally considered a functional language it does provide ways of writing code functionally. While there are aspects of JavaScript development that go against pure functional programming the concepts of functional programming can still be applied to it.
The goal with the thesis was to provide learning material for those who want to explore functional programming in the context of JavaScript development. Functional programming is often regarded as a difficult subject with heavy emphasis on theory, so this thesis aims to lower the barrier for entry by avoiding unnecessary complication of topics. Practical examples of refactoring the code of a previously developed note sharing application are used to demonstrate concepts when possible.
The quality of the code was improved by utilizing concepts of functional programming, as it made the code more readable, testable, and reusable.
Although JavaScript is not traditionally considered a functional language it does provide ways of writing code functionally. While there are aspects of JavaScript development that go against pure functional programming the concepts of functional programming can still be applied to it.
The goal with the thesis was to provide learning material for those who want to explore functional programming in the context of JavaScript development. Functional programming is often regarded as a difficult subject with heavy emphasis on theory, so this thesis aims to lower the barrier for entry by avoiding unnecessary complication of topics. Practical examples of refactoring the code of a previously developed note sharing application are used to demonstrate concepts when possible.
The quality of the code was improved by utilizing concepts of functional programming, as it made the code more readable, testable, and reusable.