Skip to content

Instantly share code, notes, and snippets.

@Diullei
Created May 3, 2016 18:01
Show Gist options
  • Save Diullei/564625ad829852688153ced6a9d18580 to your computer and use it in GitHub Desktop.
Save Diullei/564625ad829852688153ced6a9d18580 to your computer and use it in GitHub Desktop.
if (typeof(String.prototype.equals) === "undefined") {
String.prototype.equals = function(compare) {
return new RegExp('^' + this + '$', 'i').test(compare);
}
}
// example
"TESTE".quals("teste");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment