var names=new Array();
names[0]=prompt("New member name?");
You can just do this, but I have to save it to localStorage now.
var localStorage[names]=new Array();
localStorage.names[0]=prompt("New member name?");
You can't do it like this. What's wrong?
javascript html array html5
LocalStorage supports only strings. Try using JSON.stringify() and JSON.parse().
var names = [];
names[0] = prompt("New member name?");
localStorage["names"] = JSON.stringify(names);
//...
var storedNames = JSON.parse(localStorage["names"]);
Like this
577 Who developed the "avformat-59.dll" that comes with FFmpeg?
584 PHP ssh2_scp_send fails to send files as intended
623 Uncaught (inpromise) Error on Electron: An object could not be cloned
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
614 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.