回答編集履歴

1

追記

2021/12/28 07:38

投稿

ozwk
ozwk

スコア13528

test CHANGED
@@ -1,3 +1,25 @@
1
1
  `console.log`は戻り値が指定されていない関数であるため、
2
2
 
3
3
  `const a = console.log('hello');`において、`a`は`undefined`になります。
4
+
5
+
6
+
7
+ したがって、
8
+
9
+ ```js
10
+
11
+ //3
12
+
13
+ function hello(){
14
+
15
+ const a = console.log('hello');
16
+
17
+ return a;
18
+
19
+ }
20
+
21
+ ```
22
+
23
+
24
+
25
+ では、`undefined`である`a`を`return`しているので、`hello`の戻り値は`undefined`です。