localStorage的增删改查
1 var _localStorage = window.localStorage; 2 undefined 3 /* 增 */ 4 _localStorage.name = '张泰松' 5 "张泰松" 6 _localStorage['age'] = 28 7 28 8 _localStorage.setItem('address','杭州市西湖区') 9 undefined 10 /* 改 */ 11 _localStorage.name = '张泰松1' 12 "张泰松1" 13 _localStorage['age'] = 29 14 29 15 _localStorage.setItem('address','杭州市西湖区1') 16 undefined 17 /* 查 */ 18 _localStorage.age 19 "29" 20 _localStorage['name'] 21 "张泰松1" 22 _localStorage.getItem('address') 23 "杭州市西湖区1" 24 /* 删 */ 25 delete _localStorage.name 26 true 27 delete _localStorage['age'] 28 true 29 _localStorage.removeItem('address') 30 undefined