Skip to content

Instantly share code, notes, and snippets.

@lenivene
Created October 7, 2020 23:33
Show Gist options
  • Save lenivene/2b71b50e0fbc71039dea2d4fd6701970 to your computer and use it in GitHub Desktop.
Save lenivene/2b71b50e0fbc71039dea2d4fd6701970 to your computer and use it in GitHub Desktop.
Check value string is boolean
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