You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that every once in a while the program crashes on a undefined submittedUser in submittedUsers.
I used the following solution
function checkUsersValid(goodUsers) {
return function allUsersValid(submittedUsers) {
const result = submittedUsers.every(function (submittedUser) {
const result = goodUsers.some(function(goodUser) {
return submittedUser.id === goodUser.id;
});
return result;
});
return result;
};
}
module.exports = checkUsersValid
which resulted in this error
/Users/tjeerd/Development/nodeschool/program.js:11
return submittedUser.id === goodUser.id;
^
TypeError: Cannot read property 'id' of undefined
at /Users/tjeerd/Development/nodeschool/program.js:11:29
at Array.some (<anonymous>)
at /Users/tjeerd/Development/nodeschool/program.js:8:32
at Array.every (<anonymous>)
at allUsersValid (/Users/tjeerd/Development/nodeschool/program.js:6:35)
at /usr/local/lib/node_modules/functional-javascript-workshop/exercises/basic_every_some/exercise.js:35:5
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/functional-javascript-workshop/exercises/basic_every_some/exercise.js:34:9
at obtainResult (/usr/local/lib/node_modules/functional-javascript-workshop/exercises/runner.js:100:21)
at Exercise.<anonymous> (/usr/local/lib/node_modules/functional-javascript-workshop/exercises/runner.js:66:27)
I found that every once in a while the program crashes on a undefined submittedUser in submittedUsers.
I used the following solution
which resulted in this error
Using node version v8.6.0 and [email protected]
The text was updated successfully, but these errors were encountered: