It seems like jQuery’s .find() method always returns true. But that’s not really useful because you have do additionally check the length of the returned object to see if it really exists.
Anyone got a good explanation for that behaviour?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If
.find()were to return a Boolean value instead of ajQueryobject, you could not use it for chaining which is one of the overall goals of jQuery.