how to check if the first character of a string is a letter in javascript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, I鈥檓 going to show How do check if the first character of a string is a letter in Javascript, here I will use the javascript string charAt() method and regex expression to check if the first character of a string is an alphabet or not. What is a charAt() method? The String object鈥檚 charAt() method returns a new string consisting of the single UTF-16 code unit located at the specified offset into the string....

May 31, 2022 路 2 min 路 Infinitbility

How to check if the first letter of a string is uppercase in javascript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, I鈥檓 going to show How do I check if the first letter of a string is uppercase in Javascript, here I will use the javascript string toUpperCase() method and compression operator to check if the first character of a string is an capital or not. What is a toUpperCase() method? The toUpperCase() method returns the calling string value converted to uppercase (the value will be converted to a string if it isn鈥檛 one)....

May 31, 2022 路 2 min 路 Infinitbility

How to check if the first character of a string is a number JavaScript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, I鈥檓 going to show How do I check if the first character of a string is a number in Javascript, here I will use the javascript string charAt(), and isNaN() method to check if the first character of a string is a number or not. What is a charAt() method? The String object鈥檚 charAt() method returns a new string consisting of the single UTF-16 code unit located at the specified offset into the string....

May 30, 2022 路 2 min 路 Infinitbility

How to check if the first character of a string is a specific character in javascript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, I鈥檓 going to show How do I check if the first character of a string is a specific character in Javascript, here I will use the javascript string charAt() method to check if the first character of a string is a specific character or not. What is a charAt() method? The String object鈥檚 charAt() method returns a new string consisting of the single UTF-16 code unit located at the specified offset into the string....

May 30, 2022 路 2 min 路 Infinitbility

How to check if a string contains a specific character in JavaScript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, I鈥檓 going to show How do I check if a string contains a specific character in Javascript, here I will use the javascript string includes() method to check if a string contains a specific character or not. What is a includes() method? The includes() method determines whether an array includes a certain value among its entries, returning true or false as appropriate....

May 29, 2022 路 1 min 路 Infinitbility

How to check special characters in string in javascript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, I鈥檓 going to show How do I check special characters in strings in Javascript, here I will use regex expression to check special characters in a string or not. What is a special character? Special characters are symbols that do not appear on a keyboard. What are considered special characters and symbols will vary depending on your country, your installed language in Word and your keyboard like [], {}, (), #, @ etc....

May 29, 2022 路 1 min 路 Infinitbility

How to check if a string is a pangram in JavaScript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, I鈥檓 going to show How do I check if a string is a pangram in Javascript, here I will write a custom function to check if a string is a pangram or not. What is a pangram? A pangram is a string that contains every letter of the English alphabet. We are required to write a JavaScript function that takes in a string as the first and the only argument and determines whether that string is a pangram or not....

May 28, 2022 路 2 min 路 Infinitbility

How to check if two strings are anagrams of each other in Javascript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, I鈥檓 going to show How do I check if two strings are anagrams of each other in Javascript, here I will write a custom function to check if two strings are anagrams of each other or not. What is an anagram? An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once....

May 28, 2022 路 2 min 路 Infinitbility

How to check if a string is equal to another string in javascript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, I鈥檓 going to show how do you check if a string is equal to another string in javascript, here I will use the == and === operator to compare strings and check whether both are equal or not. The == in JavaScript is used for comparing two variables, but it ignores the data type of variable. The === is used for comparing two variables, but this operator also checks datatype and compares two values....

May 27, 2022 路 2 min 路 Infinitbility

How to check if a string is hexadecimal in javascript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, I鈥檓 going to show how do you check if a string is hexadecimal in javascript, here I will use the regex expression to check string is a hex code or not. Here, we will write reg expression for validating string hex code, and javascript provides test() method validate string using regex, we are also going to do same. Let鈥檚 start today鈥檚 tutorial How to check if a string is hexadecimal in javascript?...

May 27, 2022 路 1 min 路 Infinitbility

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

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, I鈥檓 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鈥檚 a pass bunch of test cases which you can see here. Let鈥檚 start the today鈥檚 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鈥檓 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鈥檓 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鈥檚 start the today鈥檚 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鈥檓 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鈥檓 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鈥檓 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鈥檓 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鈥檓 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