I’m generating JSON from a javascript object. But I do not need all attributes from the object in the JSON. Is there a way (or a library) to do this? Till now, I overrided the toJSON function and return a new Object with reduced attributes, but its a nasty workaround, isn’t it?
Share
JSON.stringifyaccepts a second parameter, a “replacer” function, that you may be able to use to exclude certain properties.