Created
January 28, 2015 23:28
-
-
Save jardix22/638049efbd652f350143 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = new Boolean(validator.isEmail(item[settings.name].toString())); | |
var b = !!validator.isEmail(item[settings.name].toString()); | |
// -- wrong email = demo@demo | |
console.log("a: ", a); // a: {} | |
console.log("b: ", b); // b: false | |
console.log("a || 'Invalid email.': ", a || 'Invalid email.'); // a || 'Invalid email.': {} | |
console.log("b || 'Invalid email.': ", b || 'Invalid email.'); // b || 'Invalid email.': Invalid email. | |
// -- email = [email protected] | |
console.log("a: ", a); // a: {} | |
console.log("b: ", b); // b: true | |
console.log("a || 'Invalid email.': ", a || 'Invalid email.'); // a || 'Invalid email.': {} | |
console.log("b || 'Invalid email.': ", b || 'Invalid email.'); // b || 'Invalid email.': true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment