We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 853a9b6 commit d3f39b2Copy full SHA for d3f39b2
4-binary/01-arraybuffer-binary-arrays/01-concat/_js.view/solution.js
@@ -1,13 +1,13 @@
1
function concat(arrays) {
2
- // sum of individual array lengths
+ // 单个数组长度求和
3
let totalLength = arrays.reduce((acc, value) => acc + value.length, 0);
4
5
if (!arrays.length) return null;
6
7
let result = new Uint8Array(totalLength);
8
9
- // for each array - copy it over result
10
- // next array is copied right after the previous one
+ // 对于每个数组 - 复制到 result
+ // 下一个数组在前一个后面复制
11
let length = 0;
12
for(let array of arrays) {
13
result.set(array, length);
4-binary/01-arraybuffer-binary-arrays/01-concat/_js.view/source.js
@@ -1,5 +1,5 @@
- // ...your code...
+ // ...您的代码...
}
let chunks = [
0 commit comments