7 lines
No EOL
237 B
JavaScript
7 lines
No EOL
237 B
JavaScript
function truthCheck(collection, pre) {
|
|
return collection.every(function (user) {
|
|
return user.hasOwnProperty(pre) && Boolean(user[pre])
|
|
});
|
|
}
|
|
|
|
console.log(truthCheck([{"single": "double"}, {"single": NaN}], "single")); |