回答編集履歴
2
コンソール出力文の修正
answer
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
var a = "";
|
6
6
|
|
7
7
|
if (a !== "" || a === null) {
|
8
|
-
console.log(a + ' is not a empty string
|
8
|
+
console.log(a + ' is not a empty string, or it is a null');
|
9
9
|
}
|
10
10
|
```
|
11
11
|
|
1
null 判定追加
answer
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
`!=` は型変換してしまうので `!==` を使います。
|
2
|
+
それから、`null` 判定がおかしいですね。`null` でない場合にマッチしてしまいます。
|
2
3
|
|
3
4
|
```JavaScript
|
4
5
|
var a = "";
|
5
6
|
|
6
|
-
if (a !== "") {
|
7
|
+
if (a !== "" || a === null) {
|
7
|
-
console.log(a + ' is not a empty string');
|
8
|
+
console.log(a + ' is not a empty string and null');
|
8
9
|
}
|
9
10
|
```
|
10
11
|
|