The fundamentals of Functional Programming, while mainly pertaining to their application in JavaScript

Introduction

Is Functional Programming any style of code that utilizes functions? If only it was that simple! Functions are indeed at the core of Functional Programming, but it’s how we use those functions that make our implementation functional.

This article aims to lay down some fundamentals of Functional Programming, while mainly pertaining to their application in , that will help you understand :

  1. What are Functions?
  2. Functions versus Procedures
  3. Declarative versus Imperative Programming
  4. Understanding Function Inputs and Outputs

These foundations will immensely aid you in grasping further concepts of Functional JavaScript, to be covered in future articles, if this one helps.


What’s “this”?

In the simplest of terms, the JavaScript keyword refers to the object it belongs to on runtime, depending upon its call-site (where it is called).

However, understanding what it would refer to in any given context, requires a slightly deeper understanding of some relevant concepts, which will be covered in this article.

Just to start with, can have the following values depending upon where it is accessed :

  • By default : refers to the global object.
  • Inside a function : refers to the global object. In strict mode, however, will be .
  • Inside a method

Animesh Pandey

Another Software Engineer traumatized by JavaScript.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store