Tag: JavaScript

First of all, what are partially applied functions? There’s a little bit of theory here. The concept of partially applying functions stems from the functional way of programming. There it’s tightly linked with a concept called currying. Currying says that every function can be written as a function with only one parameter. By currying and […]

The past few weeks were dedicated to the useful array methods. However these methods have been implemented in ECMAScript 5 and are therefore not available in older browsers such as IE8 and sometimes we have to support legacy browsers. In JavaScript, we use polyfills to create behavior that is not implemented in browser. We can […]

The past weeks we dived in the wonderful world of array methods. Previously we already discussed forEach, filter, some and every, and map. Today we’ll take a look at the reduce method. While being extremely useful, its concept can be hard to grasp. Also known as fold (in this case foldLeft) in other functional programming […]

In the previous blogpost we discussed the map method on arrays in JavaScript. We still have some useful methods the go. Next in line are the some and every methods. These methods are similar and can be very useful when validating data. The every method will check if for every element in the list, the […]

Last week we took a look at the filter functionality. This week I will show you one of my favourite array methods called: “map”. It’s extremely powerful and useful in so many ways. The purpose of map is simple, it transforms an item in an array and pushes that transformation into a new array. The […]

In the previous blogpost we discussed the forEach method that iterates over every array. We can now create a filtered array by using this function. While this will work fine, we still need to predefine our filtered array and push it in this array ourselves. We don’t need to… we could just use the filter […]

After discussing how to create a range in the last post, we will discuss some of the array methods and how to use them to make your code more readable and concise. First of all, I want to add that every array method uses the callback pattern. We’ll do a post on this pattern later, […]