質問編集履歴
1
edit code
test
CHANGED
File without changes
|
test
CHANGED
@@ -34,43 +34,43 @@
|
|
34
34
|
|
35
35
|
|
36
36
|
|
37
|
-
let added
|
37
|
+
let addedElements1 = updatedArray1.filter(x => !initialArray.includes(x));
|
38
38
|
|
39
|
-
let added
|
39
|
+
let addedElements2 = updatedArray2.filter(x => !initialArray.includes(x));
|
40
40
|
|
41
|
-
let added
|
41
|
+
let addedElements3 = updatedArray3.filter(x => !initialArray.includes(x));
|
42
42
|
|
43
|
-
let added
|
43
|
+
let addedElements4 = updatedArray4.filter(x => !initialArray.includes(x));
|
44
44
|
|
45
|
-
console.log("----- added
|
45
|
+
console.log("----- added elements -----");
|
46
46
|
|
47
|
-
console.log(added
|
47
|
+
console.log(addedElements1);
|
48
48
|
|
49
|
-
console.log(added
|
49
|
+
console.log(addedElements2);
|
50
50
|
|
51
|
-
console.log(added
|
51
|
+
console.log(addedElements3);
|
52
52
|
|
53
|
-
console.log(added
|
53
|
+
console.log(addedElements4);
|
54
54
|
|
55
55
|
|
56
56
|
|
57
|
-
let removed
|
57
|
+
let removedElements1 = initialArray.filter(x => !updatedArray1.includes(x));
|
58
58
|
|
59
|
-
let removed
|
59
|
+
let removedElements2 = initialArray.filter(x => !updatedArray2.includes(x));
|
60
60
|
|
61
|
-
let removed
|
61
|
+
let removedElements3 = initialArray.filter(x => !updatedArray3.includes(x));
|
62
62
|
|
63
|
-
let removed
|
63
|
+
let removedElements4 = initialArray.filter(x => !updatedArray4.includes(x));
|
64
64
|
|
65
|
-
console.log("----- removed
|
65
|
+
console.log("----- removed elements -----");
|
66
66
|
|
67
|
-
console.log(removed
|
67
|
+
console.log(removedElements1);
|
68
68
|
|
69
|
-
console.log(removed
|
69
|
+
console.log(removedElements2);
|
70
70
|
|
71
|
-
console.log(removed
|
71
|
+
console.log(removedElements3);
|
72
72
|
|
73
|
-
console.log(removed
|
73
|
+
console.log(removedElements4);
|
74
74
|
|
75
75
|
```
|
76
76
|
|
@@ -78,7 +78,7 @@
|
|
78
78
|
|
79
79
|
```
|
80
80
|
|
81
|
-
----- added
|
81
|
+
----- added elements -----
|
82
82
|
|
83
83
|
[]
|
84
84
|
|
@@ -88,7 +88,7 @@
|
|
88
88
|
|
89
89
|
[]
|
90
90
|
|
91
|
-
----- removed
|
91
|
+
----- removed elements -----
|
92
92
|
|
93
93
|
["b"]
|
94
94
|
|