回答編集履歴
2
タイポ
answer
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
const nextFruits = fruits.concat(newFruit); // -> ['apple', 'banana']
|
9
9
|
|
10
|
-
chrome.storage.local.
|
10
|
+
chrome.storage.local.set({ fruits: nextFruits }, function() {
|
11
11
|
/* noop */
|
12
12
|
});
|
13
13
|
});
|
1
サンプルコードの修正
answer
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
`hoge` を配列で持つ。
|
2
2
|
|
3
3
|
```
|
4
|
-
chrome.storage.local.get('
|
4
|
+
chrome.storage.local.get('fruits', function ({ fruits }) {
|
5
|
+
console.log(fruits); // ['apple']
|
5
|
-
const
|
6
|
+
const newFruit = 'banana';
|
6
7
|
|
8
|
+
const nextFruits = fruits.concat(newFruit); // -> ['apple', 'banana']
|
9
|
+
|
7
|
-
chrome.storage.local.get({
|
10
|
+
chrome.storage.local.get({ fruits: nextFruits }, function() {
|
8
11
|
/* noop */
|
9
12
|
});
|
10
13
|
});
|