Created
October 7, 2020 23:33
-
-
Save lenivene/2b71b50e0fbc71039dea2d4fd6701970 to your computer and use it in GitHub Desktop.
Check value string is 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.valueIsBool = function() { | |
return /^\s*(true|1)\s*$/i.test(this); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment