@PradneyaSP
Posted
const validEmail = (email) => { return /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/.test(email); }
Can you please explain what is going on here😅
@Oversr
Posted
@PradneyaSP I have a function assigned within a constant variable named validEmail, which takes a parameter (in this case I named it email but could be anything). Inside the function, i have a regex (the weird long line of symbols) that is tested against the parameter, and if the parameter matches, it will return true. If it does not match, it returns false. So basically it is a function that will tell whether the input is a valid email.
@PradneyaSP
Posted
@Oversr Thank You !!