We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf0e825 commit aa2cec3Copy full SHA for aa2cec3
1 file changed
src/prototype/lang/string.js
@@ -799,7 +799,7 @@ Object.extend(String.prototype, (function(){
799
* //-> false
800
**/
801
function include(pattern){
802
- return this.indexOf(pattern) > -1;
+ return this.indexOf(pattern) !== -1;
803
}
804
805
/**
@@ -945,7 +945,8 @@ Object.extend(String.prototype, (function(){
945
unfilterJSON : unfilterJSON,
946
isJSON : isJSON,
947
evalJSON : evalJSON,
948
- include : include,
+ //ECMA 6 supports contains(), if it exists map include() to contains()
949
+ include : String.prototype.contains || include,
950
// Firefox 18+ supports String.prototype.startsWith, String.prototype.endsWith
951
startsWith : String.prototype.startsWith || startsWith,
952
endsWith : String.prototype.endsWith || endsWith,
0 commit comments