直接判定該屬性值是否是undefined即可
1.vardata={a:1};
2.console.log(data.a===undefined);//false
3.console.log(data.b===undefined);//true
壹層壹層的判斷,先判斷input是否存在,如果存在就在input裏面查找age,不存在就自然跳出了。
直接判定該屬性值是否是undefined即可
1.vardata={a:1};
2.console.log(data.a===undefined);//false
3.console.log(data.b===undefined);//true
壹層壹層的判斷,先判斷input是否存在,如果存在就在input裏面查找age,不存在就自然跳出了。