This is my code, I'm using this method to validate https request parameters. Logging the entries I see that just the first element of 2 is passed and therefore not all the values are checked. What am I missing?
static validateParameters(req) {
let params = Object.entries(req.query);
return params.every(([key, value]) => {
console.log(key, value);
return value != undefined || value != ''
});
}
Edit The input to the function is a https request, the parameters would be in a 2d array
[
[ 'ids', '' ],
[ 'currencies', 'eur' ]
]
I believed the return value was undefined, but was actually an empty string. In any case changing || to && solved it.