diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-02-13 20:28:59 -0500 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-02-13 20:50:31 -0500 |
commit | db1da33321a2517cc230c78f2b5c1ce9532aca0c (patch) | |
tree | 0ce22e3d4c607bd46da6ba66fb554a732450359a /ext/mixed/js | |
parent | 75fbb1565cb9046b83c32df5f4211a62ef355067 (diff) |
Use Array.from in toIterable
Diffstat (limited to 'ext/mixed/js')
-rw-r--r-- | ext/mixed/js/core.js | 6 |
1 files changed, 1 insertions, 5 deletions
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); } } |