Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8 />
<title>Storing JSON Objects with Local Storage</title>
  <script>
    var personObject= {'givenName': 'Michel', 'familyName': 'Buffa'};
 
// Store the object as a JSON String
localStorage.setItem('testObject', JSON.stringify(personObject));
 
// Retrieve the object from storage
var retrievedObject = JSON.parse(localStorage.getItem('testObject'));
    
    console.log(retrievedObject.givenName + " " + retrievedObject.familyName);
 
// then you can use retrievedObject.firstName, retrievedObject.lastName...
  </script>
</head>
<body>
</body>
</html>
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
AuroreDechampspro
0viewers