Javascript Program for Prime Numbers
Prime numbers...
read more
Javascript Program To Check Whether Two Strings Are Anagram Of Each Other
Write a function to check whether two given strings are anagram of each other or not. An anagram of a string is another string that contains the same characters, only the order of characters can be different. For example, “abcd” and “dabc” are an anagram of each other....
read more
Dynamic Programming vs Divide-and-Conquer
In this article I’m trying to explain the difference/similarities between dynamic programming and divide and conquer approaches based on two examples: binary search and minimum edit distance (Levenshtein distance)....
read more
How to generate all combinations of a string in JavaScript ?
We are going to see if we can generate all the possible combinations of a given string using JavaScript methods or concepts. You are given a string, containing different characters, you need to generate all combinations of a string by selecting a character at once and then re-arranging that character with other characters in such a way all the combinations could be generated and printed easily in our output....
read more
How to check whether a string contains a substring in JavaScript ?
A substring is a portion of a string. It represents a sequence of characters extracted from a larger string. A substring can be as short as a single character or extend to multiple characters....
read more
JavaScript Program to Check if a Number is Odd or Even
We are going to learn how to check whether the number is Even or Odd using JavaScript. In the number system any natural number that can be expressed in the form of (2n + 1) is called an odd number and if the number can be expressed in the form of 2n is called an even number....
read more
How to remove all Non-ASCII characters from the string using JavaScript ?
In this article, we are given a string containing some non-ASCII characters and the task is to remove all non-ASCII characters from the given string....
read more
How to get a list of associative array keys in JavaScript ?
Associative Array: Associative arrays are used to store key-value pairs. For example, to store the marks of the different subjects of a student in an array, a numerically indexed array would not be the best choice. Instead, we could use the respective subjects’ names as the keys in our associative array, and the value would be their respective marks gained. In an associative array, the key-value pairs are associated with a symbol....
read more
Convert a number to a string in JavaScript
Converting numbers to strings in JavaScript is a common task that can be achieved using various methods. Understanding these methods is essential for data manipulation and presentation in web development. This guide will cover the different ways to convert numbers to strings in JavaScript, including using the toString(), String(), and template literals. Mastering these techniques ensures efficient and accurate data handling in your projects....
read more
JavaScript Strings
Strings are very important in programming languages like JavaScript. This article will help you to understand the basics of strings in JavaScript, explaining what they are and how they function in easy-to-understand terms....
read more
Generating OTP (One time Password) in PHP
Now these days, OTP (one time password) is mandatory in almost each and every service. A developer can generate OTP in many ways but the challenge is not to be predictive as any one can predict the OTP and can exploit the service....
read more
How to clone an array in JavaScript ?
In JavaScript, cloning an array means creating a new array with the same elements as the original array. Cloning an array in JavaScript is useful when you want to create a new array that has the same elements as an existing array, without modifying the original array....
read more