-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Milestone
Description
for some reason I need to write a function that return whether it a element is valid, only it return false value, I will do something
function x() {
return $( this ).valid();
}
var y = x();
// I can not write , if (!y) {} , with my reason
if (y === false) {
}
and I got a supprise the valid does not return a false value, but a falsy value 0, I check the valid() method, I found that it use bitwise & operator, but not logic && operator, I think this is bug, although, I can rewrite my function
function x() {
return !!$( this ).valid();
}
I think the statement in valid() function should be
valid = valid && validator.element(this);
instead of
valid &= validator.element(this);
Metadata
Metadata
Assignees
Labels
No labels