From 2014e8d0f4aa6d28d676eff7b55302ca861d31bd Mon Sep 17 00:00:00 2001 From: Amphiluke Date: Thu, 25 May 2017 17:12:46 +0600 Subject: [PATCH] Update the Tips section in README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9dcff4d..73e20fb 100644 --- a/README.md +++ b/README.md @@ -211,10 +211,11 @@ Note that the potential parameters are also available as direct instance propert The overridden method `toJSON()` allows the instances of the potprox potential classes to be easily serialized to a JSON string, and restored from the JSON string later on. ```javascript +// Create and serialize let morse = new potprox.Morse({d0: 0.0368, r0: 5.316, a: 0.867}); -// Serialize let json = JSON.stringify(morse); -// Unserialize + +// Unserialize and restore let potentialData = JSON.parse(json); let morseCopy = new potprox[potentialData.type](potentialData); ``` \ No newline at end of file