Cómo guardar datos en JavaScript

// object we want to save
var myObject = { name: "simon", surname: "goellner" };  
// convert to json string
var myJSON = JSON.stringify( myObject );
Matteo Salverio