How to check if a string is a valid email in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, I’m going to show you, how do you check if a string is a valid email in javascript, here I will use regex expression to valid email string. Which regex we are going to use, it’s a pass bunch of test cases which you can see here. Let’s start the today’s tutorial title How to check if a string is a valid email in javascript?...

May 26, 2022 · 2 min · Infinitbility

How to check if a string is empty or undefined in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, I’m going to show you how do you check if a string is empty or undefined in javascript, here I will use some common syntax to check string is empty, undefined, or have some value. The javascript if... else statement auto handles these types of cases like null, undefined, NaN, empty string (""), 0, and false. For all of these cases it will think falsy values, so to handle empty or undefined we have to just if....

May 26, 2022 · 2 min · Infinitbility

How to check if a string is a substring of another string in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, I’m going to show you how do you check if a string is a substring of another string in javascript, here I will use the javascript includes() method to check contains a substring or not. The includes() method determines whether an array includes a certain value among its entries, returning true or false as appropriate. Let’s start the today’s tutorial How to check if a string is a substring of another string in javascript?...

May 25, 2022 · 2 min · Infinitbility

How to check if a string is a valid json string in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, I’m going to show you how do I check if a string is a valid JSON string in javascript, here we will use the JSON.parse() method to validate string is a JSON string or not. The JSON.parse() method parses a JSON string, constructing the JavaScript value or object described by the string. An optional reviver function can be provided to perform a transformation on the resulting object before it is returned....

May 25, 2022 · 2 min · Infinitbility

How to check if a string is a date in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, I’m going to show how you validate string is a valid date or not in javascript, here I will use the Date.parse() method to check if the string is a valid date or not. The Date.parse() method parses a string representation of a date and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or NaN if the string is unrecognized or, in some cases, contains illegal date values (e....

May 24, 2022 · 2 min · Infinitbility

How to check if a string is a number in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, I’m going to show how you check if a string is a number in javascript, here I will use the javascript isNaN() built-in method to check string is a valid number or not. The isNaN() function determines whether a value is NaN (Not a number ) or not. Because coercion inside the isNaN function can be surprising, you may alternatively want to use Number....

May 24, 2022 · 2 min · Infinitbility

How to find capital letters in a string javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, we are going to do how I find capital ( uppercase ) letters in a string, here we will use some common regex to find all capital letters from a string. Here, we will learn to check whether the uppercase letter contains in string or not also, and if contain it will return as a string and array format. To remove a lowercase letter from a string we will use the javascript replace() method and it will return the rest capital letter in the type of string....

May 23, 2022 · 2 min · Infinitbility

How to find lowercase letters in a string javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, we are going to do how I find lowercase letters in a string, here we will use some common regex to find all lowercase letters from a string. Here, we will learn to check whether lowercase letter contains in string or not also, and if contain it will return as a string and array format. To remove lowercase letters from the string we will use the javascript replace() method and it will return the rest lowercase letter in the type of string....

May 23, 2022 · 2 min · Infinitbility

How to find and remove object from array in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, I’m going to show you how do I find and remove objects from the array, here I will use the javascript findIndex() method and some conditions to find the exact object in the array, and the splice() method to remove a specific element from an array using an element index value. The findIndex() method returns the index of the first element in the array that satisfies the provided testing function....

May 22, 2022 · 2 min · Infinitbility

How to find common elements in two arrays javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, I’m going to show you how do I find common elements in two arrays of javascript, here I will use javascript filter() to iterate the array and return a new array based on condition, and includes() to check string is available in an array or not. The filter() method creates a new array with all elements that pass the test implemented by the provided function....

May 22, 2022 · 2 min · Infinitbility

How to find consecutive repeated characters in a string in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, I’m going to show you how I find consecutive repeated characters in a string, here I will use some regex expression and javascript test() method to validate consecutive repeated characters in an array. The test() method executes a search for a match between a regular expression and a specified string. Returns true or false. Well, let’s start today’s topic How to find consecutive repeated characters in a string in javascript?...

May 22, 2022 · 2 min · Infinitbility

How to find and remove element from array in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, I’m going to show you how do I find and remove elements from an array in javascript, here I will use the javascript findIndex() method and some conditions to find the exact object in the array, and the splice() method to remove a specific element from an array using element index value. The findIndex() method returns the index of the first element in the array that satisfies the provided testing function....

May 21, 2022 · 2 min · Infinitbility

How to find the index of an object in an array in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, I’m going to show you how I find the index of an object in an array, here I will use the javascript findIndex() method and some conditions to find the exact object in the array. The findIndex() method returns the index of the first element in the array that satisfies the provided testing function. Otherwise, it returns -1, indicating that no element passed the test....

May 21, 2022 · 2 min · Infinitbility

How to concat two strings in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, we are going to learn concat two strings in javascript, here we will use the plus ( + ) operator to join both strings, we will also see append strings with separators like comma (,). The plus operator basically used for adding but if you use this operator between strings it will concat string. Well, let’s start today’s tutorial How to concat two strings in javascript?...

May 20, 2022 · 1 min · Infinitbility

How to solve 403 forbidden error in laravel?

Hello Friends 👋, Welcome To Infinitbility! ❤️ Today, we are going to fix 403 forbidden error in laravel, here we will see causes of laravel 403 errors and their apropriate solutions. Currently, we have 2 cases when 403 forbidden error occure, if we got any new case we will also update this post. Let’s see how laravel forbidden error looks like, where we get this error? javascript, 403 forbidden error after setup, when you try to run your laravel application, you will get screen looks live above screen shot....

May 20, 2022 · 2 min · Infinitbility

How to append an array to another array in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, we will learn to append an array to another array in javascript, here we will use the array concat() method to merge two arrays. The concat() method The concat() method is used to merge two or more arrays. This method does not change the existing arrays but instead returns a new array. – MDN So, here we will create two sample arrays like the below example, after that, we will use concat() method to append one array to another, and store it in the third array variable....

May 19, 2022 · 1 min · Infinitbility

How to append array to object in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, we will learn to add an array in an object in javascript, here we will use some common syntax of an object to store an array to an object. To add an array in the object, we will use object add elements syntax, where we have to just assign an array to an object like assign to any variable. Well, let’s start the today’s tutorial How to append an array to object in javascript?...

May 19, 2022 · 2 min · Infinitbility

How to get all values from nested json object in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, we will see how can we get all values from nested JSON objects, here we will use a custom function which will return the list of values available in a nested JSON object. So, we will create a function that navigates every possible object’s key and value and add values in an array that returns at the end of recursive loops. Well, let’s create a function that returns the values of nested objects....

May 18, 2022 · 2 min · Infinitbility

How to get count of json object in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ To get length of json object in javascript, just use the Object.keys() method with the length property. it will return the length of the object. Today, we will learn How to get a count of a JSON object in javascript, here we will use the keys() method and array length to get a count of a JSON object. Basically, The keys() method creates an array of object keys, and when we get an array, we will use simple array length syntax to get a count of objects....

May 18, 2022 · 2 min · Infinitbility

How to remove square brackets from json object in javascript?

Hi Friends 👋, Welcome To Infinitbility! ❤️ Today, we are going to learn the proper way to use an array and also remove brackets from JSON object string, here we will see the first ways to bypass removal brackets if this does not work you will also see how can we remove brackets from a JSON object. here, we will take three types of examples, if your case from mentioned in the first and the second case then go with their solution else follow the last o third case....

May 18, 2022 · 2 min · Infinitbility