同一数据Object.keys,Object.values和Object.entries获得的个数不同使用localStoragelocalStorage.setItem(`0`,`你好`);localStorage.setItem(`1`,`再见`);localStorage.setItem(`2`,`byb`);localStorage.setItem(`name`,`nono`);console.log(Object.keys(localStorage));console.log(Object.values(localStorage));console.log(Object.entries(localStorage));console.log(`---------`);for(var a in localStorage){ console.log(localStorage[a]); }输出结果:设置自定义对象输出结果:
添加回答
举报
0/150
提交
取消