From 6f848e63e7c0407c3fde16ad85bb63e04c2c8229 Mon Sep 17 00:00:00 2001 From: Andrew Rivera <34843760+onthegocode@users.noreply.github.com> Date: Fri, 30 Sep 2022 09:30:32 -0700 Subject: [PATCH] Updating flip.js for loop Converted for loop into a forEach Method to use less code and no repetition. --- dist/flip.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/dist/flip.js b/dist/flip.js index b7dce76..3c47d55 100644 --- a/dist/flip.js +++ b/dist/flip.js @@ -208,7 +208,6 @@ if (!Object.keys) { 'propertyIsEnumerable', 'constructor' ], - dontEnumsLength = dontEnums.length; return function(obj) { if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { @@ -224,11 +223,9 @@ if (!Object.keys) { } if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); - } - } + dontEnums.forEach(dontEnums => { + if (hasOwnProperty.call(obj, dontEnums)) result.push(dontEnums); + }); } return result; }; @@ -6149,4 +6146,4 @@ module.exports = API; }()); -}(window, window.Tick || [])); \ No newline at end of file +}(window, window.Tick || []));