回答編集履歴

1

OKならtrue、NGならfalseにした

2019/04/02 04:17

投稿

miyabi-sun
miyabi-sun

スコア21158

test CHANGED
@@ -58,11 +58,11 @@
58
58
 
59
59
  const name = nameAndCondition[i];
60
60
 
61
- const condition = nameAndCondition[i + 1];
61
+ const condition = nameAndCondition[i + 1] === 'OK';
62
62
 
63
63
  // もしNGの都市を捨てるならこの行のコメントアウトを削る
64
64
 
65
- // if (condition === 'NG') continue;
65
+ // if (!condition) continue;
66
66
 
67
67
  result[name] = condition;
68
68
 
@@ -76,11 +76,11 @@
76
76
 
77
77
  // [
78
78
 
79
- // {千代田区: "OK", 中央区: "OK", 港区: "OK", 新宿区: "OK", 文京区: "NG"},
79
+ // {千代田区: true, 中央区: true, 港区: true, 新宿区: true, 文京区: false},
80
80
 
81
- // {横浜市: "NG", 川崎市: "OK", 横須賀市: "OK"},
81
+ // {横浜市: false, 川崎市: true, 横須賀市: true},
82
82
 
83
- // {千葉市: "OK", 銚子市: "NG", 市川市: "NG"}
83
+ // {千葉市: true, 銚子市: false, 市川市: false}
84
84
 
85
85
  // ]
86
86