回答編集履歴

2

コンソール出力文の修正

2016/02/23 03:23

投稿

think49
think49

スコア18194

test CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  if (a !== "" || a === null) {
14
14
 
15
- console.log(a + ' is not a empty string and null');
15
+ console.log(a + ' is not a empty string, or it is a null');
16
16
 
17
17
  }
18
18
 

1

null 判定追加

2016/02/23 03:22

投稿

think49
think49

スコア18194

test CHANGED
@@ -1,4 +1,6 @@
1
1
  `!=` は型変換してしまうので `!==` を使います。
2
+
3
+ それから、`null` 判定がおかしいですね。`null` でない場合にマッチしてしまいます。
2
4
 
3
5
 
4
6
 
@@ -8,9 +10,9 @@
8
10
 
9
11
 
10
12
 
11
- if (a !== "") {
13
+ if (a !== "" || a === null) {
12
14
 
13
- console.log(a + ' is not a empty string');
15
+ console.log(a + ' is not a empty string and null');
14
16
 
15
17
  }
16
18