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
| 1 ^ 1 === 0 //checkada (1) é == 1 então retorna 0 | |
| 0 ^ 1 === 1 //não checkada (0) é != 1 então retorna 1 |
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
| input.checked = 0; | |
| input.checked = false; |
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
| input.checked = 1 ^ 1; //1 e 1 são iguais (não me diga?) | |
| input.checked = 0; |
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 input = $('input')[0]; | |
| input.checked = input.checked ^ 1; |
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
| $('input')[0].checked ^= 1; |
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
| input.checked = input.checked ^ 1; | |
| input.checked = true ^ 1; //converte implicitamente true para 1; false para 0 | |
| input.checked = 1 ^ 1; |
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
| ^ | 0 1 | |
| --+----- | |
| 0 | 0 1 | |
| 1 | 1 0 |
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
| <<< +true | |
| >>> 1 | |
| <<< +false | |
| <<< 0 | |
| >>> !!1 | |
| <<< true | |
| >>> !!0 | |
| <<< false |
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
| >>> 1 == true | |
| <<< true | |
| >>> 0 == false | |
| <<< true |
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
| [] == false //ToPrimitive deste array retorna string vazia | |
| "" == false //comparação com boolean converte booleano ToNumber | |
| "" == 0 //comparação de string com número converte string ToNumber | |
| 0 == 0 | |
| true |