How to get minutes between two dates in javascript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get minutes between two dates, Get both dates as a time using the getTime() method. subtract them which you get using the getTime() method. Devied your output time with / (1000 * 60) % 60 It will return your difference in dates in a minutes. The getTime() method returns the number of milliseconds since the ECMAScript epoch. You can use this method to help assign a date and time to another Date object....

June 7, 2022聽路聽2 min聽路聽Infinitbility

How to check if a string is alphanumeric in JavaScript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check string is alphanumeric, use this regex /^[a-z0-9]+$/i if it gets true means the string contains only alphabets and numbers. Today, I鈥檓 going to show How do I check if a string is alphanumeric in javascript, here I will use the javascript test() method and regex as mentioned above to validate whether the string is alphanumeric or not. Let鈥檚 start the today鈥檚 tutorial How do you check if a string is alphanumeric in javascript?...

June 6, 2022聽路聽1 min聽路聽Infinitbility

How to check if a number is divisible by another number in javascript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check if a number is divisible by another number, use the remainder ( % ) operator if get 0 means the number is divisible else not. Note: Here, another number is any number like 3, 4, 5, 6, 7, 8, etc. Today, I鈥檓 going to show How do I check if a number is divisible by another number in javascript, here I will use the modulo ( % ) operator and if....

June 5, 2022聽路聽2 min聽路聽Infinitbility

How to check if a number is between two values in javascript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check if a number is between two values, Apply greater then and less than both conditions with and ( && ) operator. if get true means a number in a range. Note: Here we are using && operator to reduce the number of codes, there have a lot of ways to do that Today, I鈥檓 going to show How do I check if a number is between two values in javascript, here I will write some conditions and an if....

June 4, 2022聽路聽2 min聽路聽Infinitbility

Guide to use onflow flow-js-testing framework

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To use flow-js-testing and run test cases of cadence smart contract, You have to install node.js, flow CLI after you able to run your test cases in flow emulator using npm run test command. Note: Here, we are running kitty-items test cases For NFT cadence smart contract Today, I鈥檓 going to show How do I run test cases of cadence smart contract using flow js testing, here I will use onflow kitty items repo https://github....

June 3, 2022聽路聽2 min聽路聽Infinitbility

How to create multiple nodes in the node-red single module?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To create multiple nodes in a single module or package, just put one more key and values in your package.json file where node-red/nodes is mentioned. like the below example. "node-red" : { "nodes": { "lower-case": "lower-case/lower-case.js", "upper-case": "upper-case/upper-case.js" } }, Note: We can make n number of custom nodes in a single module but every node should have different js and html. Today, I鈥檓 going to show How do I create multiple nodes in the node-red single module, here I will create a custom node of lower-case and upper-case in a single package....

June 3, 2022聽路聽3 min聽路聽Infinitbility

How to check if number is prime in javascript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check number is a prime number, looping through 2 to your given number-1 and check is any divisible number or not, if have means it鈥檚 not a prime number. Note: 1 is considered neither prime nor composite. Today, I鈥檓 going to show How do I check if the number is a prime number or not in Javascript, here I will create a custom function isPrimeNumber() where I will check if there have any divisible number based on this it will return a boolean value....

June 2, 2022聽路聽2 min聽路聽Infinitbility

How to check if a character is a letter or number in JavaScript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check character is a letter or number, JavaScript provides the isNaN() method just pass your character as a parameter it will check character is NaN ( Not a number ) when it returns false means the character is a number else validate the character with regex code /^[a-zA-Z]+$/ to check is a letter or not. Today, I鈥檓 going to show How do I check if a character is a letter or number in Javascript, here I will use the javascript string isNaN() method, and regex code /^[a-zA-Z]+$/` to check if a character is a letter or number....

June 1, 2022聽路聽2 min聽路聽Infinitbility

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

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, I鈥檓 going to show you, how do you check if a string is a valid URL in javascript, here I will use the regex expression to validate URL string. To validate the string URL, I will use the below regex which can handle the below cases. protocol Domain name address IP (v4) address port and path URL query string fragment locator function isValidURL(str) { var pattern = new RegExp('^(https?...

June 1, 2022聽路聽2 min聽路聽Infinitbility

How to check if number is integer or float in javascript?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check number is an integer or float, JavaScript provides isInteger() method just pass your number as a parameter and it will return true if the number is an integer or else false. Today, I鈥檓 going to show How do I check if the number is an integer or float in Javascript, here I will use the javascript string isInteger() method, to check if a number is an integer or float....

June 1, 2022聽路聽2 min聽路聽Infinitbility

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