回答編集履歴
2
ちょうせい
test
CHANGED
@@ -2,12 +2,8 @@
|
|
2
2
|
|
3
3
|
const callback=(x,y)=>x[1]==y[1]?0:x[1]<y[1];
|
4
4
|
|
5
|
-
var list = [["aaa",10],["bbb",20],["ccc",""],["ddd",30],["eee",40]];
|
6
|
-
|
7
|
-
console.dir(list.sort(callback));
|
8
|
-
|
9
5
|
var list = [["aaa",100],["bbb",10],["ccc",""],["ddd",30],["eee",40]];
|
10
6
|
|
11
|
-
console.dir(list.sort(callback));
|
7
|
+
console.dir(list.sort(callback));
|
12
8
|
|
13
9
|
```
|
1
ちょうせい
test
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
+
```javascript
|
2
|
+
|
1
|
-
const callback=(x,y)=>x[1]==y[1]?
|
3
|
+
const callback=(x,y)=>x[1]==y[1]?0:x[1]<y[1];
|
2
4
|
|
3
5
|
var list = [["aaa",10],["bbb",20],["ccc",""],["ddd",30],["eee",40]];
|
4
6
|
|
@@ -7,3 +9,5 @@
|
|
7
9
|
var list = [["aaa",100],["bbb",10],["ccc",""],["ddd",30],["eee",40]];
|
8
10
|
|
9
11
|
console.dir(list.sort(callback));
|
12
|
+
|
13
|
+
```
|