回答編集履歴

1

chousei

2021/04/23 02:50

投稿

yambejp
yambejp

スコア116835

test CHANGED
@@ -3,3 +3,27 @@
3
3
  ary=ary.map(x=>x.map(Number));
4
4
 
5
5
  ```
6
+
7
+
8
+
9
+ # 任意の多次元
10
+
11
+ ```javascript
12
+
13
+ const numb=a=>a instanceof(Array)?a.map(x=>numb(x)):Number(a);
14
+
15
+ let ary = [
16
+
17
+ [ '1','2','3'],
18
+
19
+ [ '4',['5','6'],['7',['8',['9']]]],
20
+
21
+ [ 'a', 'b', ['c','d']],
22
+
23
+ ];
24
+
25
+ ary=numb(ary);
26
+
27
+ console.log(ary);
28
+
29
+ ```