質問するログイン新規登録

質問編集履歴

2

タグとタイトルを変更

2020/03/04 03:20

投稿

huwatoro
huwatoro

スコア19

title CHANGED
@@ -1,1 +1,1 @@
1
- jQueryオブジェクトを検索して変数がundefinedであっても、式全体での判定をしたい
1
+ ネストされた可変キーのオブジェクトからプロパティ掘り進む時にundefinedになる
body CHANGED
File without changes

1

errorをnotextへ変更

2020/03/04 03:20

投稿

huwatoro
huwatoro

スコア19

title CHANGED
File without changes
body CHANGED
@@ -53,7 +53,7 @@
53
53
  fruits2('apple','jp'); // 問題なし
54
54
  fruits2('xxx','jp'); // notextとなってOK
55
55
  function fruits2(item,lang){
56
- const name = obj['parent'][item] ? obj['parent'][item][lang] : 'error';
56
+ const name = obj['parent'][item] ? obj['parent'][item][lang] : 'notext';
57
57
  console.log('fruits2' + name);
58
58
  }
59
59
  ```