Last active
December 16, 2015 08:49
-
-
Save UltCombo/5408691 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
//para testar se nosso objeto jQuery possui elementos: | |
if ($el.length) {/*...*/} | |
//isto é equivalente à: | |
if ($el.length !== 0) {/*...*/} | |
//Já que .length sempre é um número >= 0, também podemos escrever: | |
if ($el.length > 0) {/*...*/} | |
//e para ver se não possui nenhum elemento: | |
if (!$el.length) {/*...*/} | |
//isto equivale à: | |
if ($el.length === 0) {/*...*/} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment