回答編集履歴

1

thenの連結について補足

2020/02/05 03:18

投稿

thyda.eiqau
thyda.eiqau

スコア2982

test CHANGED
@@ -42,8 +42,22 @@
42
42
 
43
43
  ```js
44
44
 
45
+ /*
46
+
47
+ result = [
48
+
49
+ {id: 1, name: 'Alice'},
50
+
51
+ {id: 2, name: 'Bob'},
52
+
53
+ {id: 3, name: 'Charlie'}
54
+
55
+ ]; の場合
56
+
57
+ */
58
+
45
59
  .then(result => result.map(name => name.id))
46
60
 
47
- .then(ids => /* name.idの配列が渡る */)
61
+ .then(ids => { console.log(ids); }) // [1, 2, 3]
48
62
 
49
63
  ```