Bugfix:binary-arrays/concat/solution
This commit is contained in:
parent
2cca9a9d09
commit
ae0a73fc1a
1 changed files with 2 additions and 2 deletions
|
@ -2,9 +2,9 @@ function concat(arrays) {
|
|||
// sum of individual array lengths
|
||||
let totalLength = arrays.reduce((acc, value) => acc + value.length, 0);
|
||||
|
||||
if (!arrays.length) return null;
|
||||
|
||||
let result = new Uint8Array(totalLength);
|
||||
|
||||
if (!arrays.length) return result;
|
||||
|
||||
// for each array - copy it over result
|
||||
// next array is copied right after the previous one
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue