Concatenation of two strings in PHP
There are two string operators. The first is the concatenation operator (‘.‘), which returns the concatenation of its right and left arguments. The second is the concatenating assignment operator (‘.=‘), which appends the argument on the right side to the argument on the left side....
read more
Implementation of LinkedList in Javascript
In this article, we will be implementing the LinkedList data structure in Javascript. LinkedList is the dynamic data structure, as we can add or remove elements at ease, and it can even grow as needed. Just like arrays, linked lists store elements sequentially, but don’t store the elements contiguously like an array....
read more
Reverse a String in JavaScript
We have given an input string and the task is to reverse the input string in JavaScript. It is a very common question asked in a JavaScript interview. There are various methods to reverse a string in JavaScript, which are described below with examples....
read more
How to create two dimensional array in JavaScript ?
A two-dimensional array in JavaScript is an array of arrays, used to represent data in a matrix or grid format. It’s useful for organizing data in rows and columns, such as tables, spreadsheets, or game boards, facilitating complex data manipulation and storage....
read more
Binary Search In JavaScript
Binary Search is a searching technique that works on the Divide and Conquer approach. It is used to search for any element in a sorted array. Compared with linear, binary search is much faster with a Time Complexity of O(logN), whereas linear search works in O(N) time complexity...
read more
Iterate over an array in JavaScript
Iterating over arrays in JavaScript is a fundamental task that developers frequently perform. JavaScript provides several methods to iterate through arrays, including for, forEach(), map(), filter(), reduce(), and for…of. Each method has its specific use cases, benefits, and best practices. This guide explores these different array iteration methods, demonstrating how to effectively loop through arrays to manipulate and access their elements in JavaScript....
read more
How to Remove Duplicates from an Array of Objects in JavaScript?
This article focuses on removing duplicate object elements from the JavaScript array. We are provided with an array of objects, and our goal is to eliminate duplicate objects from the list....
read more
How to get all unique values (remove duplicates) in a JavaScript array?
We are going to learn How to get all unique values (remove duplicates) in a JavaScript array. Given an array with various values, our objective is to filter out any duplicates and display the resulting array in the console....
read more
How to make first letter of a string uppercase in JavaScript ?
In JavaScript, transforming the first letter of a string to uppercase is a common task, crucial for maintaining consistent text formatting and enhancing readability. Utilizing built-in string manipulation functions facilitates this process, ensuring user-friendly display and improving the overall user experience in web applications....
read more
Implementation of Binary Search Tree in Javascript
In this article, we would be implementing the Binary Search Tree data structure in Javascript. A tree is a collection of nodes connected by some edges. A tree is a non linear data structure. A Binary Search tree is a binary tree in which nodes that have lesser value are stored on the left while the nodes with a higher value are stored at the right....
read more
How to create hash from string in JavaScript ?
To create a unique hash from a specific string, it can be implemented using its own string-to-hash converting function. It will return the hash equivalent of a string. Also, a library named Crypto can be used to generate various types of hashes like SHA1, MD5, SHA256, and many more....
read more
Implementation of Stack in JavaScript
Implementation of a stack in JavaScript involves creating a data structure that follows the Last-In-First-Out (LIFO) principle, where elements are added and removed from the same end. We use stacks to manage function calls, undo functionality, and parse algorithms efficiently in JavaScript applications....
read more