判斷一個json是否存在某個對象。json
正確的作法是code
data = {"mch_id":"12345678","hb_type":"NORMAL","hblist":"dddd"}; if(data != null && data.hblist != null) { console.log('找到hblist了'); } else console.log('沒有找到');