Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var obj = {
- a: 1,
- b: {
- c: 2,
- notMe: "super secret"
- },
- d: 3
- };
- var str = JSON.stringify(obj, function replacer(key, value) {
- if (this && key === "notMe" && this.c === 2)
- return undefined;
- return value;
- });
- { "a": 1, "b": { "c": 2 }, "d": 3 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement