I have an object that has some properties and methods, like so:
{name: \"FirstName\",
age: \"19\",
load: function () {},
uniq: 0.5233059714082628}
Not something I would ever do but it is worth mentioning that there are ways to stringify function (i.e. it is not impossible).
Take the following:
var func = function(){console.log('logged')};
var strFunc = func.toString();
//then
var parsedFunc = eval('('+strFunc+')');
parsedFunc();
//or simply
eval('('+strFunc+')()');
//or
eval('('+strFunc+')')();
//or
eval('var anotherFunc='+strFunc);
anotherFunc()
The above with an overridden toJSON() can achieve a shallow stringified function;
DISCLAIMER: look into this and other articles and make your own decision before using eval()