Is there an “exists” function for jQuery

JavaScript
if ($(selector).length)
Source

Also in JavaScript: