I am trying to compare two passwords, New Password and Confirm New Password, this should very simple and straight forward.
But i don't know why this isn't working. Exhausted
if (newpassword !== confnewpassword) {
console.log('New:"'+newPassword+'" and Conf:"'+confnewpassword+'" Password Do Not Match');
}else{
//some server code
}
Also Tried
if (newpassword === confnewpassword) {
//Some Server Code
}else{
console.log('New:"'+newPassword+'" and Conf:"'+confnewpassword+'" Password Do Not Match');
}
Console Output is New:"timecapsule7" and Conf:"timecapsule7" Password Do Not Match
because your newpassword
is undefined
. your string is in newPassword
(check the camelCase). Javascript don't work by that way.
Any good editor or some linting would have saved you from this situation.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments