How to Avoid Array Mutation

In this article, I’ll focus on showing how to add, edit and remove items in an array causing mutation and non-mutation ways. Some things we need to keep in mind when writing code avoiding mutation is to return a new one after the update. It’s a common approach when working with functional programming and if you want to understand some concepts of functional programming I recommend you read this article I wrote some time ago....

April 2, 2020 · 4 min · Helder Burato Berto

Understanding concepts of functional programming with JavaScript

Let’s understand the fundamental concepts of functional programming using JavaScript language. The abbreviation FP will be used within this article to reference functional programming. Object Example In this article we’ll use the following object in our practical examples like the following: const animals = [ { name: "Max", species: "dog", likes: ["bones", "carrots"], }, { name: "Teodore", species: "cat", likes: ["mice", "carrots"], }, ]; What is functional programming? FP is the basis in Lambda Calculus - a formal system developed in the 1930s....

February 3, 2020 · 3 min · Helder Burato Berto

What is a Pure Function?

Whenever you are told about pure functions, keep the following in mind. Pure Functions are functions the given an input parameter will always return the same output without causing side effects. When do Side Effects occur? Side Effects occur when an executed function changes state within the application, which are known as impure functions. Why Pure Functions? I will mention some topics that make the use of function so interesting....

June 16, 2019 · 2 min · Helder Burato Berto