Bubble Sort algorithm using JavaScript
Bubble sort algorithm is an algorithm that sorts an array by comparing two adjacent elements and swapping them if they are not in the intended order. Here order can be anything like increasing or decreasing....
read more
How to get the last character of a string in JavaScript ?
We are going to learn how can we get the last character of a string in JavaScript. we have given a string of size len, the task is to get the last character of a string using JavaScript....
read more
Generating Random String Using PHP
Generate a random, unique, alpha-numeric string using PHP. Examples:...
read more
Split an array into chunks in JavaScript
Splitting an array into chunks in JavaScript involves dividing the array into smaller arrays of a specified size. This process is useful for managing large datasets more efficiently or for processing data in smaller, more manageable portions within the application....
read more
Get the first and last item in an array using JavaScript
JavaScript array is used to store multiple elements in a single variable. It is often used when we want to store a list of elements and access them by a single variable. We will learn how to get the first & last element in an array in JavaScript, along with understanding their implementation through the examples....
read more
How to convert string to camel case in JavaScript ?
We will be given a string and we have to convert it into the camel case. In this case, the first character of the string is converted into lowercase, and other characters after space will be converted into uppercase characters. These camel case strings are used in creating a variable that has meaning....
read more
Implementation of Queue in Javascript
In This article, we will be implementing Queue data structure in JavaScript. A Queue works on the FIFO(First in First Out) principle. Hence, it performs two basic operations which are the addition of elements at the end of the queue and the removal of elements from the front of the queue. Like Stack, Queue is also a linear data structure....
read more
Program to find absolute value of a given number
Given an integer N, The task is to find the absolute value of the given integer....
read more
Implementation of Graph in JavaScript
Implementing graphs in JavaScript is crucial for visualizing data structures and relationships. JavaScript provides various ways to create and manage graphs, including adjacency lists, adjacency matrices, and edge lists. This guide will cover the basics of graph implementation in JavaScript, demonstrating how to represent and traverse graphs using these methods. Whether you’re building a network visualization, a recommendation system, or a pathfinding algorithm, understanding graph implementation will enhance your JavaScript development skills....
read more
Add new elements at the beginning of an array using JavaScript
In this article, we will learn how to add new elements at the beginning of an array using JavaScript. We can do this by using the following methods:...
read more
How to find the sum of all elements of a given array in JavaScript ?
Finding the sum of all elements in a given array in JavaScript involves iterating through the array and accumulating the values using a loop or array method like reduce(). This process yields the total sum of all array elements....
read more
Create a comma separated list from an array in JavaScript
In this article, we will see how to convert an array into a comma-separated list using JavaScript. To do that, we are going to use a few of the most preferred methods....
read more