🚀 CYBER WEEK SALE: 50% OFF on JavaScript Fundamentals 💪

How to properly clear a timeout in JavaScript

A timeout in JavaScript is a useful tool to asynchronously delay the execution of the function. It requires 2 arguments: the function that you’d like to set for the async execution, and the delay after which the function will be called. ...

August 5, 2022 · 2 min · Coderslang Master

How to capitalize first letter of every word with JavaScript

In this tutorial you’ll learn how to change the first letter of every word to upper case using JavaScript. Capitalizing with split, for loop and join If you’re just getting started with JavaScript, then I suggest the most obvious step-by step approach to capitalizing each word in string....

August 4, 2022 · 2 min · Coderslang Master

How to check the latest version of the npm package

If you’re looking to find out what’s the latest version of a certain package, you can quickly check this information right in your terminal with the command npm view. Here’s how you can check the latest version of express:...

August 3, 2022 · 1 min · Coderslang Master

How to find the version of any installed npm package

In this short tutorial you’ll learn how to check the version of any installed npm package including the ones that have been installed globally using the -g flag. Locally installed packages To check the current versions of the npm packages for your project, you should navigate to the project directory where your package....

August 2, 2022 · 1 min · Coderslang Master

How to update all npm package.json dependencies to the latest version

It’s essential to keep all the node modules of your project up to date as the security patches go out. In this short tutorial I’ll teach you how to update all the node_modules to the latest version with a single command....

August 1, 2022 · 2 min · Coderslang Master

How to use BEM naming convention with SCSS

This article is for the intermediate level. This article explains the importance of writing better CSS class names with code snippets using SCSS. This article is targeted for the group of people who are interested to learn about BEM naming convention and want simple and descriptive explanation to what block, element and modifiers in BEM are....

July 16, 2022 · 6 min · Coderslang Master

The difference between dependencies and devDependencies in package.json

The file package.json is an integral part of every Node.js project. It stores all the dependencies that your project needs. All the dependencies (most often open-source npm modules) are split into two categories: production dependencies and development dependencies....

June 2, 2022 · 2 min · Coderslang Master

4 JavaScript array functions that every Junior must know

If you’re new to JavaScript arrays, you’d be surprised how many useful built-in functions they have. Today, I’ll show you 4 of them. You can also get a deeper dive into a specific topic by reading dedicated articles:...

June 1, 2022 · 2 min · Coderslang Master

How to transform a JS array with "map"

In this tutorial you’ll learn how you can use the function map to transform the JavaScript array by applying a mapping function to all of its elements. The biggest drawback of the forEach loop is that it doesn’t return anything useful....

September 9, 2022 · 2 min · Coderslang Master

How to reduce a JavaScript array to a single value

The reduce function is the most complex of the standard JavaScript array functions. With reduce, you can compress (reduce) an array to one element. For the reduce function to work properly, you’ll need 2 parameters — the reducer function and the initial value....

May 19, 2022 · 4 min · Coderslang Master