回答編集履歴

2

タイポ

2019/07/24 02:50

投稿

og24715
og24715

スコア832

test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
 
18
18
 
19
- chrome.storage.local.get({ fruits: nextFruits }, function() {
19
+ chrome.storage.local.set({ fruits: nextFruits }, function() {
20
20
 
21
21
  /* noop */
22
22
 

1

サンプルコードの修正

2019/07/24 02:50

投稿

og24715
og24715

スコア832

test CHANGED
@@ -4,13 +4,19 @@
4
4
 
5
5
  ```
6
6
 
7
- chrome.storage.local.get('hoge', function ({ hoge }) {
7
+ chrome.storage.local.get('fruits', function ({ fruits }) {
8
8
 
9
+ console.log(fruits); // ['apple']
10
+
9
- const nextHoge = hoge.concat(newHoge);
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({ hoge }, function() {
19
+ chrome.storage.local.get({ fruits: nextFruits }, function() {
14
20
 
15
21
  /* noop */
16
22