Created
September 9, 2016 11:40
-
-
Save x1unix/fabb5ff713b89bea0d469793c0555ba9 to your computer and use it in GitHub Desktop.
indexOf as boolean
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
String.prototype.contains = function(char) { | |
return !!(~this.indexOf('1')); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment