回答編集履歴

1

sample

2018/03/01 03:06

投稿

yambejp
yambejp

スコア114825

test CHANGED
@@ -23,3 +23,65 @@
23
23
 
24
24
 
25
25
  できればcsvはテーブル表記ではなく、文字列として例示された方がよいと思います
26
+
27
+
28
+
29
+ # samplle
30
+
31
+ 仮にすべて配列に収まった状態だとして、listをつかってmasterをフィルタして
32
+
33
+ 結果をresultに受ける処理ならこんな感じです
34
+
35
+ ```javascript
36
+
37
+ var list=[
38
+
39
+ ["insert1","000001"],
40
+
41
+ ["insert2","000002"],
42
+
43
+ ["insert2","000003"],
44
+
45
+ ["insert3","000004"],
46
+
47
+ ["insert3","000005"],
48
+
49
+ ["insert4","000006"],
50
+
51
+ ["insert4","000007"],
52
+
53
+ ];
54
+
55
+ var master=[
56
+
57
+ ["000001","リンゴ","aaa.jpg","aaa.html"],
58
+
59
+ ["000002","パイン","bbb.jpg","bbb.html"],
60
+
61
+ ["000003","かき","ccc.jpg","ccc.html"],
62
+
63
+ ["000004","メロン","ddd.jpg","ddd.html"],
64
+
65
+ ["000005","レモン","eee.jpg","eee.html"],
66
+
67
+ ["000006","スイカ","fff.jpg","fff.html"],
68
+
69
+ ["000007","ドリアン","ggg.jpg","ggg.html"],
70
+
71
+ ["000008","みかん","hhh.jpg","hhh.html"],
72
+
73
+ ["000009","ぶどう","iii.jpg","iii.html"],
74
+
75
+ ];
76
+
77
+ var result=master.filter(function(x){
78
+
79
+ return list.some(function(y){ return y[1]=== x[0];})
80
+
81
+ });
82
+
83
+ console.log(result);
84
+
85
+
86
+
87
+ ```