Javascript Articles

Sorted By: Most Recent
Abdullah Bashir Abdullah Bashir
Updated on November 05, 2024

Prisma Build “Environment Variable Not Found: DATABASE_URL” Error Solved

Prisma “environment variable not found: DATABASE_URL” error occurs when there’s a disconnect between the schema and the environment variables. Learn to solve it.

Image: Shutterstock / Built In
Shashwat Nautiyal Shashwat Nautiyal
Updated on November 04, 2024

A Guide to ESLint, Prettier, Husky and Lint-Staged

ESLint, Prettier, Husky and lint-staged are code editing tools that can be used to correct errors and format code for consistency pre-commit. Here’s how they work. 

Image: Shutterstock / Built In
Akshay Kumar Akshay Kumar
Updated on October 31, 2024

How to Filter a JavaScript Array With the Filter() Method

The JavaScript filter() method iterates through an array and returns a filtered copy with elements that meet a condition. Learn how to use it.

Image: Shutterstock / Built In
Dr. Derek Austin Dr. Derek Austin
Updated on October 29, 2024

How to Make JavaScript Sleep or Wait

JavaScript doesn’t have a dedicated sleep() function that causes the code to wait before resuming execution. Here's how to write a JavaScript sleep function using setTimeout().

Image: Shutterstock / Built In
Chris Cook Chris Cook
Updated on October 09, 2024

How to Check for Log Errors With Jest

There are two ways to check for log errors with the JavaScript testing framework Jest: jest.fn() or jest.spyOn(). Here’s how to do it, with code.  

Image: Shutterstock / Built In
Yordan Ramchev Yordan Ramchev
Updated on October 08, 2024

How to Auto Import Vue Components in JavaScript

Setting up on-demand auto importing for Vue components makes it easier to eliminate typos in import paths and reduces final production build size. Learn more.

Image: Shutterstock / Built In
Shahar Polak Shahar Polak
Updated on October 07, 2024

How to Stop a ForEach Loop in JavaScript

A JavaScript forEach loop is a control flow statement that iterates through arrays. It can be stopped by throwing an error. Learn more.

Image: Shutterstock / Built In
Jayanth Somineni Jayanth Somineni
Updated on September 27, 2024

How to Remove Duplicates From a JavaScript Array

When you need to remove duplicates from an array in JavaScript, consider these methods.

Image: Shutterstock / Built In
Michelle Wong Michelle Wong
Updated on September 13, 2024

Switch Case vs. If-Else in JavaScript Explained

Switch case and if-else offer two different approaches to writing conditional statements in JavaScript. Here’s how to determine which one to use.

Image: Shutterstock / Built In
Rakia Ben Sassi Rakia Ben Sassi
Updated on September 10, 2024

Compiler vs. Interpreter in Programming

Compilers and interpreters are used to convert a high-level language into machine code. However, there are differences between how and when they work.

Image: Shutterstock / Built In