One of the most fundamental operations in programming is storing and organizing data. To help effectively manage data, we can organize it into lists. In JavaScript these lists are often organized into arrays. We organize…
Category: JavaScript
JavaScript Scope: What is it?
In JavaScript, the concept of scope relates to where variables and expressions can be accessed from. In this article we’ll look at a few different types of scope, what they do and how you use…
JavaScript: Tagged template literals
The template literal syntax is a very useful feature in JavaScript. One often overlooked feature of template literals is the ability to use a tag function to perform actions on them. Instead of immediately assigning…
JavaScript variables: Getting started
Learn all about JavaScript variables in this guide for beginners. You can think of variables as containers of information. Variables allow a way of labeling data with a descriptive name. They are not values themselves,…
Create a modal overlay using JavaScript
One common feature in many web pages and apps are modals. Modal windows and overlays serve as structural elements for many different types of content, such as images and videos, forms, alerts and notices and…
Get the extension of a filename using JavaScript
In the last post we had a look at some common string methods in JavaScript. In this post we’ll combine a couple of those string methods in a useful function that will return the extension…
Common String Methods
Working with strings in JavaScript can be a breeze if you take advantage of the built-in string methods. Here are a few of the most commonly used string methods in JavaScript. slice() The slice() method…
Array and Object Destructuring
The destructuring syntax in JavaScript was introduced in ES6 and is a powerful expression that makes working with Arrays and Objects much more manageable and provides added flexibility. You might have already been using destructuring…
How to use a for loop
Loops are a very important concept in programming and the for loop is a classic. Almost all languages have an implementation of the for loop. I think they are foundational to control flow and can…
How to use switch statements
Switch statements are a useful when you need to evaluate an expression against multiple possibilities. They can be a great alternative to other conditional statements like using multiple else if statements. Lets have a look…