回答編集履歴
2
タイポ
test
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
-
chrome.storage.local.
|
19
|
+
chrome.storage.local.set({ fruits: nextFruits }, function() {
|
20
20
|
|
21
21
|
/* noop */
|
22
22
|
|
1
サンプルコードの修正
test
CHANGED
@@ -4,13 +4,19 @@
|
|
4
4
|
|
5
5
|
```
|
6
6
|
|
7
|
-
chrome.storage.local.get('
|
7
|
+
chrome.storage.local.get('fruits', function ({ fruits }) {
|
8
8
|
|
9
|
+
console.log(fruits); // ['apple']
|
10
|
+
|
9
|
-
const ne
|
11
|
+
const newFruit = 'banana';
|
10
12
|
|
11
13
|
|
12
14
|
|
15
|
+
const nextFruits = fruits.concat(newFruit); // -> ['apple', 'banana']
|
16
|
+
|
17
|
+
|
18
|
+
|
13
|
-
chrome.storage.local.get({
|
19
|
+
chrome.storage.local.get({ fruits: nextFruits }, function() {
|
14
20
|
|
15
21
|
/* noop */
|
16
22
|
|