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
// Prevent Default Behavior | |
// 'return false' stops the default behavior of the event | |
// and prevents it from bubbling up DOM, which kills | |
// event delegation and may not be what you indented. | |
// You might consider using e.preventDefault() or | |
// e.stopPropagation() instead | |
//event.preventDefault() | |
//Event Delegation Friendly |
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
// Use === and !== | |
// It is often better to use the === and !== operators | |
// rather than == and != operators. The reason for this | |
// is that === and !== (also known as the identity operators) | |
// check for the type as well as the value when being compared | |
// whereas the == and != will try to coerce the two values | |
// into the same type before the comparison is made, which | |
// may lead to some very unexpected results. |
NewerOlder