代码拉取完成,页面将自动刷新
var obj = {
id: "0001",
type: "donut",
name: "Cake",
ppu: 0.55,
batters: {
batter: [
{ id: "1001", type: "Regular" },
{ id: "1002", type: "Chocolate" },
],
},
topping: [
{ id: "5001", type: "None" },
{ id: "5002", type: "Glazed" },
],
};
// console.log(JSON.stringify(obj, ["topping", "id"], 2));
// var obj2json = {
// name: "dx",
// firstName: "l",
// age: 25,
// toJSON() {
// return `{fullName:${this.firstName}${this.name},age:${this.age}}`
// },
// };console.log(JSON.stringify(obj2json,(key,v)=>{
// console.log("key",key)
// console.log("v",v)
// return v
// },2));
const user = {
name: "patrick Singh",
age: 26,
};
console.log(JSON.stringify(user,(k,v)=>{
console.log('k',k)
console.log('v',v)
console.log(typeof v)
console.log("-----")
if(typeof v=="string"){
return undefined
}
return v
},"***"))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。