chg: simplified code

This commit is contained in:
Tobi Schäfer 2020-03-21 12:05:41 +01:00
parent a0f5729e58
commit 90e91ee9f7

View file

@ -438,9 +438,7 @@ String.prototype.pad = function(str, length, mode) {
* @param Boolean
*/
String.prototype.contains = function(str, fromIndex) {
if (this.indexOf(str, fromIndex ? fromIndex : 0) > -1)
return true;
return false;
return this.indexOf(str, fromIndex || 0) > -1;
};