Mohit Panchasara

Mohit Panchasara

67 Articles Published

Articles by Mohit Panchasara

Page 7 of 7

How to create a Password Checklist in ReactJS?

Mohit Panchasara
Mohit Panchasara
Updated on 16-Feb-2023 7K+ Views

Nowadays, applications use a one-time password or magic link for authentication, but we can’t ignore the authentication using the username and password. Whenever we allow users to register with a username and password, we should ensure that the password users have entered is strong. So, it can be unbreakable by hackers. In this tutorial, we will learn to verify the security level of the password in ReactJS. Create a Custom Validation Algorithm We can create a custom validation algorithm to check if the password is strong or weak. We can create regular expressions for lowercase, uppercase, and numeric ...

Read More

HTMLCollection for Loop

Mohit Panchasara
Mohit Panchasara
Updated on 16-Feb-2023 7K+ Views

The HTML collection is an array of HTML elements. We can access every element of the collection using its index. Also, we can iterate through the array of HTML collections and get all HTML elements of the collection one by one. Sometimes, we require to use for loop to iterate through the collection of all HTML elements. For example, we have created a group of checkboxes, and when the user presses the clear button, we require to clear all checkboxes. We can access all checkboxes in the HTML collection, iterate through it, and uncheck every checkbox. In this tutorial, ...

Read More

How to uncheck a radio button using JavaScript/jQuery?

Mohit Panchasara
Mohit Panchasara
Updated on 16-Feb-2023 30K+ Views

Sometimes, we require to uncheck a radio button using JavaScript or JQuery. For example, we use the radio button in the form. When the user presses the clear form button, we need to uncheck all radio buttons and allow again users to choose any option from the radio button. In this tutorial, we will learn various methods to uncheck single or multiple radio buttons using JQuery or JavaScript. Use the JavaScript to uncheck the radio button We can access the radio button in JavaScript using id, tag, name or other ways. After that, we can uncheck the radio ...

Read More

How to transform a String into a function in JavaScript?

Mohit Panchasara
Mohit Panchasara
Updated on 16-Feb-2023 3K+ Views

We have given a string and need to convert it into a function in JavaScript. Sometimes, we get mathematical or function expressions in the form of the string, and executing that expression, requires converting strings into the function expression. In this tutorial, we will learn different approaches to converting the given string into a functional or mathematical expression. Use the eval() method The eval() method takes the expression as a parameter and evaluates the expression. For example, if we pass the ‘2 + 2’ string as a parameter of the eval() method, it returns 4 as it evaluates the ...

Read More

How to transform a JavaScript iterator into an array?

Mohit Panchasara
Mohit Panchasara
Updated on 16-Feb-2023 2K+ Views

In JavaScript, the iterator is a collection of elements through which we can iterate and access a single element every iteration. The set, map, or object is an iterator in JavaScript, and we can’t access the elements of the iterator using the index like the array. So, we first require to convert the iterator into the array. Here, we will use different methods like an array.from(), etc., to convert an iterator to the array. Use the for-of loop The for-of loop iterates through every element of the iterator lie set and map. Inside the for-of loop, we can ...

Read More

How to toggle between one checkbox and a whole group of checkboxes in HTML?

Mohit Panchasara
Mohit Panchasara
Updated on 16-Feb-2023 2K+ Views

The toggling means that whenever a user checks a single checkbox, all checkboxes of the group should be unchecked, and when a user checks any checkbox from the group, a single checkbox should be unchecked. We can achieve this functionality with JavaScript. In this tutorial, we will learn to toggle between one checkbox and a whole group of checkboxes in HTML. Syntax Users can follow the syntax below to toggle between one checkbox and a whole group of checkboxes in HTML. checkboxes.forEach((checkbox) => { checkbox.checked = false; }) In the above syntax, checkboxes is ...

Read More

How to skip over an element in .map()?

Mohit Panchasara
Mohit Panchasara
Updated on 16-Feb-2023 17K+ Views

In JavaScript, we sometimes require to skip array elements while using the map() method. For example, we need to map value from one array to another array after performing some mathematical operations on the element only if the array value is finite. In such cases, users can use the below approaches to skip over array elements while using the map() method. Use the if-else statement In the array.map() method, we can use the if-else statement to skip over the element. If the element fulfills the if-else statement condition, we need to return the element for mapping; Otherwise, we ...

Read More
Showing 61–67 of 67 articles
« Prev 1 3 4 5 6 7 Next »
Advertisements