This example illustrates one method of serializing and recreating class instances by using the replacer and reviver parameters to JSON.stringify and JSON.parse respectively.
replacer
reviver
JSON.stringify
JSON.parse