My goal is to only return the error message if any value is falsy, and never return the hooray message. I am utilizing lodash.
var jawn = [
{
"cheese" : true,
"with" : true,
"without" : true
},
{
"cheese" : true,
"with" : true,
"without" : true
},
{
"cheese" : true,
"with" : false,
"without" : true
},
{
"cheese" : true,
"with" : true,
"without" : true
}
];
_.forEach(jawn, function (item) {
if(item.with === false) {
console.log('error');
} else {
console.log('hooray');
}
});