The Ultimate Guide to JavaScript Algorithms

Tools

To a significant level, the success of a software engineer is highly dependent on the quality of the tools he uses for his craft. In this section, we will highlight the tools that feature prominently in this course as well as examine their relevance to our overall objectives.

Let’s dive right in!

Code Editors

For this, we have a handful of options:

These are all very great tools for development and you can work with whichever one suits you. However, for the purpose of this course, we'd be using VS Code.

A snapshot of code.visualstudio.com

Note: If you would want to get better at using VS Code, there’s a wonderful course here on Scotch that’d bring you up to speed.

Making Sure Our Algorithms Work: Jest

Jest is a JavaScript testing library. It is an open-source project maintained by Facebook. It is especially used for testing React applications, but can be used for testing any JavaScript code. Its major strengths include:

  • it’s speed
  • it’s snapshot testing ability
  • it requires very little configuration and is packed with powerful tools out-of-the-box.

A snapshot of jestjs.io

In this course, we will use Jest to set the requirements for the algorithms and then test with it to see if we have successfully fulfilled all requirements. It’d also enable us compare various algorithms to see how they perform(time taken).

Checking Algorithm Performance: JSPerf

  • JsPerf is a tool created by Mathias Bynens in 2010 to benchmark JavaScript performance within the browser using Benchmark.js. It’s primary function is to test different code snippets to see which is faster and it can perform this across different browsers, versions and devices. A snapshot of jsperf.com

We will use jsperf.com to create public tests cases to compare the performance of the various algorithms we identify for each challenge.

This is by no means an exhaustive list of all the tools we will be making use of in this course, however these are the tools that will be featured prominently. In cases where we use a tool that isn’t mentioned here, we will make sure to discuss them sufficiently.

Like this article? Follow @worldclassdev on Twitter