提供了 hasOwnProperty 函数,可以通过 hasOwnProperty 函数来判断:


if (result.hasOwnProperty('code') && !result.code) {

}