You were very close from the solution.
If several properties match, you will add the 'row' for each match.
Just add it once per row, after loop on condition and loop on prop ended.
It is a matter of curly brace position :
var results = [];
for (var i =0; i<source.length; i++) {
var row = source[i];
var match = true;
var samePropCount = 0;
for (var prop in row) {
for (var cond in conditions) {
if (cond === prop ) {
samePropCount++;
if (conditions[cond] != row[prop]) {
match = false;
}
}
}
}
if (!samePropCount) match=false;
if (match) {
results.push(row);
}
}
return results;