Building the Javascript .map() function from scratch

Probably one of the most used and most powerful functions ( .reduce() might be the most important) in the Javascript language is the .map() function (And let’s not forget it’s somewhat closely related cousin .forEach()). Both of these functions allow us to...

Demystifying the new keyword in Javascript

Javascript’s ‘new’ keyword goes hand-in-hand with the object oriented programming paradigm in which the code written aims to mimic things and actions in the real world. A dog can run and jump, a user can login and logout. In the world of Javascript,...

JavaScript closures: What are they?

A closure in JavaScript is a pretty obscure concept to grasp, especially when starting out. They’re one of the more important building blocks and concepts in JS that enable many other features in the language to work. (Like iterators and generators, and even...

Using JavaScript to validate parentheses

Let’s explore how we can use JavaScript to determine whether or not a string containing parentheses, square brackets, and/or curly braces has an equal number of opening and closing brackets/braces. Essentially we’re going to determine if a string such as...

Implementing a word cloud with React

I actually had this come up as an interview question once, and it was more of a theoretical discussion on how I would implement it, as opposed to actually having me white board it/live code it. I thought it would be good practice to re-visit this and implement a quick...