From 90e91ee9f7917f7f3d3410156cf2dd5232e93bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Sat, 21 Mar 2020 12:05:41 +0100 Subject: [PATCH] chg: simplified code --- modules/core/String.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/core/String.js b/modules/core/String.js index 3124eec7..d1b1090d 100644 --- a/modules/core/String.js +++ b/modules/core/String.js @@ -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; };