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
arrayA - if
AA === Bforfalsehe stops walking thearrayand returnsfalse - if no item from
arrayreturnfalsethen returntrue
I hadn’t noticed that, +1
– Elaine