watwatwat

Untitled

Oct 31st, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const object = {
  2.     p1: 'Hello World',
  3.     p2: 3,
  4.     p3: true,
  5. }
  6.  
  7. const json_object = JSON.stringify(object);
  8. /* output ->
  9. "{"p1":"Hello World","p2":3,"p3":true}"
  10. */
  11.  
  12. JSON.parse(json_object);
  13. /* output ->
  14. {
  15.     p1: 'Hello World',
  16.     p2: 3,
  17.     p3: true,
  18. }
  19. */
Add Comment
Please, Sign In to add comment