JavaScript Hoisting

This post is to help my future self, specifically for the times when I am debugging JavaScript and trying to understand another one of it’s odd habits. What is Hoisting? When I first heard the term hoisting being applied to a programming language, my first thought was like a flag being raised up a flagpole, […]

Which RxJS operator should I use?

The RxJS documentation has a excellent feature called Operator Decision Tree which makes choosing an operator easier. Starting at the RxJS home page, select API docs and then the Operator Decision Tree. By responding to each question asked about what you are trying to achieve you will be guided to the appropriate operator. The animated […]

Sorting numbers within a JavaScript array

The problem You need to sort this JavaScript array in numeric order: Arrays have a sort method, so lets try using that The output from running this in Chrome 67 is that the array is now sorted as: [1, 11, 2] Which is not what we want, the number 11 is in the wrong place. […]

Debugging JavaScript: Logging

If your JavaScript  executes but not how you expect it to, one method to find out what is going on is to add code to the script that outputs information to the console as the script executes. Vanilla Logging The method that most JavaScript developers default to is to use console.log similar to the screen […]