为什么 JSON.stringify() 不显示 prop2?
var newObj = {
prop1: true,
prop2: function(){
return "hello";
},
prop3: false
};
alert( JSON.stringify( newObj ) ); // prop2 appears to be missing
alert( newObj.prop2() ); // prop2 returns "hello"
for (var member in newObj) {
alert( member + "=" + newObj[member] ); // shows prop1, prop2, prop3
}
JSFIDDLE:http: //jsfiddle.net/egret230/efGgT/