回答編集履歴

2

別解

2021/09/10 05:45

投稿

yambejp
yambejp

スコア116738

test CHANGED
@@ -15,3 +15,17 @@
15
15
  console.log(res);
16
16
 
17
17
  ```
18
+
19
+
20
+
21
+ # 別解
22
+
23
+ ```javascript
24
+
25
+ const date = new Date();
26
+
27
+ const res=["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"].map(x=>Date.prototype[`get${x}`].call(date));
28
+
29
+ console.log(res);
30
+
31
+ ```

1

ちょうせい

2021/09/10 05:44

投稿

yambejp
yambejp

スコア116738

test CHANGED
@@ -5,8 +5,6 @@
5
5
  ```javascript
6
6
 
7
7
  const date = new Date();
8
-
9
- console.log({...date});
10
8
 
11
9
  const ms=date.getMilliseconds();
12
10