回答編集履歴

2

プロパティの修正

2018/05/22 06:35

投稿

og24715
og24715

スコア832

test CHANGED
@@ -8,6 +8,6 @@
8
8
 
9
9
 
10
10
 
11
- max.zip // -> "zip"
11
+ max.field // -> "zip"
12
12
 
13
13
  ```

1

最大の要素の任意のプロパティを取り出す

2018/05/22 06:35

投稿

og24715
og24715

スコア832

test CHANGED
@@ -4,10 +4,10 @@
4
4
 
5
5
  ```js
6
6
 
7
- max = errors.sort((p, n) => (n.id - p.id))[0];
7
+ max = errors.sort((p, n) => (n.id - p.id))[0]; // -> {id: "5", field: "zip", msg: "郵便番号は必須項目です", rule: "required", scope: null}
8
8
 
9
9
 
10
10
 
11
- max // -> {id: "5", field: "zip", msg: "郵便番号は必須項目です", rule: "required", scope: null}
11
+ max.zip // -> "zip"
12
12
 
13
13
  ```