JSON.stringify 的第二参数 JSON.stringify({a:1, b:2, c:3}, ['a','c']) // '{"a":1,"c":3}' 第二个参数replacer可以传函数过滤,if判断返回undefined,但是如foo是数组会用null代替过滤位。第二个参数replacer也可以作为数组,直接过滤foo的属性