diff --git "a/39 \351\203\255\346\202\246\350\277\216/20231129 \346\234\254\345\234\260\345\255\230\345\202\250.md" "b/39 \351\203\255\346\202\246\350\277\216/20231129 \346\234\254\345\234\260\345\255\230\345\202\250.md" new file mode 100644 index 0000000000000000000000000000000000000000..6674de62680bb9973d12fa077e8da4b344b16ca9 --- /dev/null +++ "b/39 \351\203\255\346\202\246\350\277\216/20231129 \346\234\254\345\234\260\345\255\230\345\202\250.md" @@ -0,0 +1,115 @@ +## 复习笔记 + +1. 清空整个 localStorage + + localStorage.clear() + +2. 本地存储只能存放字符串,复杂的数据要先转换成字符串,再存入 + + JSON.stringify(复杂数据) + +3. 从本地取复杂数据转成的字符串,不能直接用,要重新还原回对象 + + JSON.PARSE(字符串) + +4. 数组的常用操作方法,一种是用遍历数据,有返回值;另一种是用指定的字符串,拼接数组元素 + +5. 如果用变量做属性名,只能用 [ ] 括号 + +6. 本地储存 + + localStorage.setItem() + + 获取 localStorage.getItem() + + localStorage.remove() + + 查,同增 localStorage.setItem() + +------ + +## 作业 + +```html + +``` \ No newline at end of file