連想配列を別のものにフィルタリングするにはどうすればいいですか?あなたはtry catch
ブロックせずに配列をfiter可能性が事前にJavascriptフィルタ配列と別の配列との連想配列
function filter (a,f) {
console.log (a) ;
console.log (f) ;
//Using f as filter, How to get only these rows fom a ?
//{"XD_A":"XDR","XD_B_1":"38","XD_B_2":"PB"},
//{"XD_A":"XDR","XD_B_1":"38","XD_B_2":"PB"},
}
function test() {
var data = [{"XD_A":"XDL","XD_B_1":"38","XD_B_2":"PB"},
{"XD_A":"XDR","XD_B_1":"51","XD_B_2":"PB"},
{"XD_A":"XDL","XD_B_1":"58","XD_B_2":"PB"},
{"XD_A":"XDR","XD_B_1":"38","XD_B_2":"PB"},
{"XD_A":"XDL","XD_B_1":"76","XD_B_2":"PB"},
{"XD_A":"XDR","XD_B_1":"38","XD_B_2":"PB"}] ;
var filters =[{"XD_A":"XDR"},{"XD_B_1":"38"}] ;
filter (data,filters) ;
}
おかげで、
よろしく
マッシモ
は私たちにあなたがしようとしている何かを示して? – kukkuz
var rf = _.dropRightWhile(data、filters);しかし成功なし。フィルタは動的に変更され、「増加」します –