1
I have a problem with return
since the node
is all asynchronous.
var myFUNC = function(A, B) {
A.every(function(AA) {
return (AA === B);
});
return true;
};
if(!myFUNC(...)) {
....
}
obviously the function always returns true
but she shouldn’t be doing this, as I’m starting with node
, I don’t know how to resolve this impasse.
She should follow the following logic:
- sweeps the
array
A
- if
AA === B
forfalse
he stops walking thearray
and returnsfalse
- if no item from
array
returnfalse
then returntrue
I hadn’t noticed that, +1
– Elaine