Is there a function or library that will take a JS Object that has properties and functions and stringify it to JSON but when it comes to a Function, it will change it into a property and call the function to return its value??
function object() {
this.property = 12;
this.function = function() { return "This"; }
}
So this would stringify into:
{property: 12, function: "This"}
Any ideas? Just curious if there is one already.. if not I will take a stab at one. It shouldn't be to hard to extend a JSON.stringify().