Javascript Algorithms Articles

Sorted By: Most Recent
Akshay Kumar Akshay Kumar
Updated on December 16, 2024

Guide to the JavaScript Reduce Method

JavaScript reduce method is a higher order function that reduces arrays to a single function. Here’s what to know.

Image: Shutterstock / Built In
K. Jagathish K. Jagathish
Updated on December 16, 2024

How to Find Values in a JavaScript Array

Finding a value in an array is useful for effective data analysis. Learn how to discover what a JavaScript Array contains using indexOf, includes, for loop, some methods and more.  

Image: Shutterstock / Built In
Richmond Alake Richmond Alake
Updated on December 06, 2024

Bubble Sort Time Complexity and Algorithm Explained

Bubble sort is a sorting algorithm that uses comparison methods to sort an array. It has an average time complexity of O(n^2). Here’s what you need to know.

Image: Shutterstock / Built In
Akshay Kumar Akshay Kumar
Updated on November 20, 2024

A Guide to Callback Functions in JavaScript

A callback function in JavaScript is a function that’s called after the first function has completed its task. Learn more about how they’re used and when to use them.

Image: Shutterstock / Built In
Odumosu Matthew Odumosu Matthew
Updated on November 12, 2024

How to Format Dates in JavaScript

JavaScript offers a variety of ways to format dates, including using the date object, intl.DateTimeFormat and a number of date libraries. Here’s how to use each one. 

Image: Shutterstock / Built In
John Au-Yeung John Au-Yeung
Updated on November 07, 2024

How to Loop Through JavaScript Associative Arrays

There are three common ways to loop through a JavaScript associative array object, including the for-in loop, object.entries with forEach and the for-of loop. Here’s how.

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
Akshay Kumar Akshay Kumar
Updated on October 30, 2024

50 Top JavaScript Interview Questions With Example Answers

Review these common JavaScript interview questions and answers and practice your coding fundamentals with this guide to ace your next interview.

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