更新时间:2023-11-05 12:39:40
您可以使用 JSON.stringify
带有 replacer
像:
JSON.stringify({
color: 'red',
doSomething: function (arg) {
alert('Do someting called with ' + arg);
}
}, function(key, val) {
return (typeof val === 'function') ? '' + val : val;
});