質問編集履歴

2

例の修正

2023/01/11 01:28

投稿

yusuke1
yusuke1

スコア19

test CHANGED
File without changes
test CHANGED
@@ -77,7 +77,7 @@
77
77
  上の例だと、2次元目のオブジェクトのプロパティである`__typename: 'SelectedOption'`だけを取り除いた配列にしたい。そのほかはそのままの状態です。
78
78
 
79
79
  ### 試したこと
80
- 以下のよう、filterとmapを駆使してもうまくいかなかったです。
80
+ 以下のよう、mapを駆使してもうまくいかなかったです。
81
81
 
82
82
  ```
83
83
  const lineItemProductVariants = items.map((item) =>

1

説明の修正

2023/01/11 01:12

投稿

yusuke1
yusuke1

スコア19

test CHANGED
File without changes
test CHANGED
@@ -80,7 +80,7 @@
80
80
  以下のよう、filterとmapを駆使してもうまくいかなかったです。
81
81
 
82
82
  ```
83
- const lineItemProductVariants = items.filter((item) =>
83
+ const lineItemProductVariants = items.map((item) =>
84
84
  item.map((item.selectedOption) => ({
85
85
  selectedOptions: { name: selectedOption.name, value: selectedOption.value },
86
86
  }))