- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path26_with_multiple_value.js
More file actions
Latest commit
25 lines (20 loc) · 699 Bytes
/
Copy path26_with_multiple_value.js
File metadata and controls
25 lines (20 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
constmember=['lutfy','Zoro','Sanji'];
localStorage.setItem('SHP',JSON.stringify(member));
// getItem lutfy
constlutfyy=JSON.parse(localStorage.getItem('SHP'));
// index 0 without JSON.parse will print [,
// index 1 will print l, dsst
console.log(lutfyy[0]);
letmarineford;
if(localStorage.getItem('marineford')){
marineford=JSON.parse(localStorage.getItem('marineford'));
}else{
marineford=[];
}
console.log(marineford);// []
// marineford.push('kizaru');
// // marineford.push('akainu');
// localStorage.setItem('marinford', JSON.stringify(marineford));
marineford.push('Garp');
marineford.push('akainu');
localStorage.setItem('marineford',JSON.stringify(marineford));