File tree Expand file tree Collapse file tree 4 files changed +123
-123
lines changed
4-binary/01-arraybuffer-binary-arrays Expand file tree Collapse file tree 4 files changed +123
-123
lines changed Original file line number Diff line number Diff line change 1
1
function concat ( arrays ) {
2
- // sum of individual array lengths
2
+ // somma delle lunghezze dei singoli array
3
3
let totalLength = arrays . reduce ( ( acc , value ) => acc + value . length , 0 ) ;
4
4
5
5
if ( ! arrays . length ) return null ;
6
6
7
7
let result = new Uint8Array ( totalLength ) ;
8
8
9
- // for each array - copy it over result
10
- // next array is copied right after the previous one
9
+ // ogni array, lo copiamo in result
10
+ // l' array successivo viene copiato subito dopo quello precedente
11
11
let length = 0 ;
12
12
for ( let array of arrays ) {
13
13
result . set ( array , length ) ;
Original file line number Diff line number Diff line change 1
1
function concat ( arrays ) {
2
- // ...your code ...
2
+ // ...il vostro codice ...
3
3
}
4
4
5
5
let chunks = [
Original file line number Diff line number Diff line change 1
1
2
- # Concatenate typed arrays
2
+ # Concatenate TypedArrays
3
3
4
- Given an array of ` Uint8Array ` , write a function ` concat(arrays) ` that returns a concatenation of them into a single array.
4
+ Dato un array di ` Uint8Array ` , scrivete una funzione ` concat(arrays) ` che ritorna una loro concatenazione in un singolo array.
You can’t perform that action at this time.
0 commit comments