I am trying to use lodash 2.4.1 to find out if at least one element exists in an array with trueas its value.
So, I decided to use the lodash someor function any.
This is what my code looks like:
if ( _.some([lineup.reachesMaxForeignPlayers(), lineup.reachesBudgetLimit()], true) ) {
response.send(400, "La inclusión de este jugador no satisface las reglas del juego");
}
What never happens inside an if block, even if the first condition really evaluates to true.
I got:
console.log(lineup.reachesMaxForeignPlayers());
console.log(lineup.reachesBudgetLimit());
Before the block ifand I can see the first statement evaluating the value true.
What could it be unsuccessful?
I am using lodash 2.4.1 as it includes a Sails js dependency.
source
share