JavaScript


  • The nullish coalescing operator (??) is a relatively new addition to the JavaScript language (introduced in ES2020). It is a logical operator that returns the right side operand when the left side operand is null or undefined, and otherwise returns the left side operand. It is similar to the logical OR operator (||), however it…

    Read more →

  • Introduced in ECMAScript 2020, Optional Chaining is a a modern feature in JavaScript that allows you to read the value of a property located deep within a chain of nested object properties, without having to explicitly validate each reference in the chain. This simplifies the process of handling potential null or undefined values without the…

    Read more →

  • In JavaScript, arrays are one of the most commonly used data structures. They are a collection of elements, each with a unique index or key. JavaScript offers a variety of methods to work with arrays that make it easy to manipulate and transform your data. This short series will list out some of the most…

    Read more →

  • In JavaScript, arrays are one of the most commonly used data structures. They are a collection of elements, each with a unique index or key. JavaScript offers a variety of methods to work with arrays that make it easy to manipulate and transform your data. This short series will list out some of the most…

    Read more →

  • In JavaScript, arrays are one of the most commonly used data structures. They are a collection of elements, each with a unique index or key. JavaScript offers a variety of methods to work with arrays that make it easy to manipulate and transform your data. This short series will list out some of the most…

    Read more →

  • Somewhat recently, I was looking through some example code (JavaScript) for a project and I came across the following syntax: I hadn’t seen this format before so it took me a second to parse through what it was doing. Essentially, this is just a fancy way of returning a single value from within an unnamed…

    Read more →

  • As of ES6, we are able to set default parameter values when defining a function, as shown below: This allows for named parameters to be initialized with default values if no value is present or it evaluates to undefined. If you want to call a function without passing one of the parameters, allowing it to fall…

    Read more →

  • Node.js is a perfect runtime to create a CLI script that can run on any machine that has Node installed. A CLI program in Node is really just an ordinary Node.js app. In order to make the program available to be executed by your machine, we need to do a couple of small setup steps.…

    Read more →

  • When debugging in JavaScript, browser extenstions can be a potential source of confusion. At the very least, they may add additional noise to the process. In order to make sure you’re not dealing with any extra code outside of your application, you can use Incognito Mode to browse in private. This disables all of your extensions…

    Read more →

  • Object-Oriented Programming (OOP) is a popular programming paradigm that allows us a way to structure and maintain complex code. Unlike other programming languages that use class-based object orientation, JavaScript uses prototype-based object orientation. This difference may be a source of confustion for developers coming from a class-based language, especially when using the “syntactical sugar” of…

    Read more →