From db1da33321a2517cc230c78f2b5c1ce9532aca0c Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Thu, 13 Feb 2020 20:28:59 -0500 Subject: Use Array.from in toIterable --- ext/mixed/js/core.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'ext') diff --git a/ext/mixed/js/core.js b/ext/mixed/js/core.js index ca9e98e5..c273bb87 100644 --- a/ext/mixed/js/core.js +++ b/ext/mixed/js/core.js @@ -113,11 +113,7 @@ function toIterable(value) { if (value !== null && typeof value === 'object') { const length = value.length; if (typeof length === 'number' && Number.isFinite(length)) { - const array = []; - for (let i = 0; i < length; ++i) { - array.push(value[i]); - } - return array; + return Array.from(value); } } -- cgit v1.2.3