Guest User

Untitled

a guest
Jan 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. var stateObject = getState();
  2. console.log( "Current State:" );
  3. console.log( stateObject );
  4.  
  5. var json = JSON.stringify( stateObject );
  6. console.log( "JSON representation:" );
  7. console.log( json );
  8.  
  9. var setState = function ( json ) {
  10.  
  11. var stateObject = JSON.parse( json );
  12. console.log( "Set this state:" );
  13. console.log( stateObject );
  14.  
  15. };
  16.  
  17. $('input').val( '' );
  18. setState( json );
Add Comment
Please, Sign In to add comment