JavaScript – Sum of Digits of a Number

In this article, we will learn how to find the sum of digits of a given number. The sum of digits can be obtained by…

  • Reading time:31 mins read

JavaScript – Reverse a String

In this article, we’ll look at three basic ways to reverse a string in JavaScript: the built-in reverse() method, a for loop, and the spread operator + reverse(). Using…

  • Reading time:21 mins read

JavaScript – Find the Intersection of Two Arrays

In this article, we will explore how to implement a function in JavaScript to find the intersection (Common Elements) of two arrays. The problem Write…

  • Reading time:13 mins read

JavaScript – Convert an array to an object

There are many ways to convert an array to an object in JavaScript. Let's explore some of the common approaches - Using reduce() const array…

  • Reading time:14 mins read

JavaScript – Shuffle an array in a random order

To shuffle an array in random order in JavaScript, you can use the sort() function with Math.random() or use the map() & sort() function. Let's…

  • Reading time:17 mins read

JavaScript – Add elements to a JSON Array

In JavaScript, you can add elements to a JSON array in several ways. Here are some common methods : Using push method The push() method in JavaScript…

  • Reading time:23 mins read

JavaScript – Remove specific property from an object

To remove a specific property from an object in JavaScript, you can use the delete operator or create a new object without those properties. Let's explore some…

  • Reading time:23 mins read

JavaScript – Convert an object to an array

There are many ways to convert an object to an array in JavaScript. Let's explore some common approaches. Convert Object Values to Array If you…

  • Reading time:17 mins read

JavaScript – Sort array of numbers

To sort an array of numbers in JavaScript, you can use the built-in sort() method. However, it's important to note that the sort() method sorts the elements as strings…

  • Reading time:13 mins read

JavaScript – Filter out falsy values from an array

In this post we will explore how to filter out falsy values from an array in JavaScript. Falsy values in JavaScript include false, 0, "", null, undefined, and NaN. We will…

  • Reading time:26 mins read

JavaScript – Check if an object is empty

There are many ways to check if an object is empty. In this post we will explore two methods. Let's dive in! Using for loop…

  • Reading time:15 mins read

JavaScript – Convert callback to promise

To convert a callback function to a promise in JavaScript, you can create a new Promise object. Inside the promise, you call the original function with a…

  • Reading time:20 mins read