Warning: Under Construction. I am using this site as my playground as I buildĀ gatsby-mdx and gatsby themes. During this time I will also repost new contentĀ to Medium

Quick Tip: JavaScript Partially Applied Functions

Say we have the following function:

<code class="javascript">
function increaseBy(x){
return function(y){
return x + y;

We can use this function to create new, higher order functions that increase a number by a certain value.

for example:

<code class="javascript">
var incByThree = increaseBy(3);

gives us a function we can then use later in our code as such:

<code class="javascript">
//returns 7
//returns 8

We can also create multiple higher-order functions and have each of them use a different x value;

<code class="javascript">
var incByThree = increaseBy(3);
var incByFour = increaseBy(4);
//returns 9
//returns 10