Skip to content

Commit d3f39b2

Browse files
committed
arraybuffer: add trans for solution js
1 parent 853a9b6 commit d3f39b2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
function concat(arrays) {
2-
// sum of individual array lengths
2+
// 单个数组长度求和
33
let totalLength = arrays.reduce((acc, value) => acc + value.length, 0);
44

55
if (!arrays.length) return null;
66

77
let result = new Uint8Array(totalLength);
88

9-
// for each array - copy it over result
10-
// next array is copied right after the previous one
9+
// 对于每个数组 - 复制到 result
10+
// 下一个数组在前一个后面复制
1111
let length = 0;
1212
for(let array of arrays) {
1313
result.set(array, length);

Diff for: 4-binary/01-arraybuffer-binary-arrays/01-concat/_js.view/source.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function concat(arrays) {
2-
// ...your code...
2+
// ...您的代码...
33
}
44

55
let chunks = [

0 commit comments

Comments
 (0)