pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/front42/en.javascript.info/commit/ae0a73fc1a8a9a9b53df76eaf46a18b49ebea96f

nonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-9c8f61f9f58ad7b2.css" /> Bugfix:binary-arrays/concat/solution · front42/en.javascript.info@ae0a73f · GitHub
Skip to content

Commit ae0a73f

Browse files
Bugfix:binary-arrays/concat/solution
1 parent 2cca9a9 commit ae0a73f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • 4-binary/01-arraybuffer-binary-arrays/01-concat/_js.view

4-binary/01-arraybuffer-binary-arrays/01-concat/_js.view/solution.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ function concat(arrays) {
22
// sum of individual array lengths
33
let totalLength = arrays.reduce((acc, value) => acc + value.length, 0);
44

5-
if (!arrays.length) return null;
6-
75
let result = new Uint8Array(totalLength);
6+
7+
if (!arrays.length) return result;
88

99
// for each array - copy it over result
1010
// next array is copied right after the previous one

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy