SOURCE

let person = {
  name: "vince",
  age: 24,
  friends:["alisa", "bob"]
}
let str = JSON.stringify(person, function(key, value) {
  switch(key){
    case "age":
      return value + 1
    case "friends":
      return value.join("/")
    default:
      return value
  }
})
console.log(str)
console 命令行工具 X clear

                    
>
console