The tests of that challenge https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true doesn’t pass on what looks like a correct solution :
function truthCheck(collection, pre) {
return collection.every(function(element) {
return element.hasOwnProperty(pre) && Boolean(element.pre);
});
}
but passes on this solution :
function truthCheck(collection, pre) {
return collection.every(function(element) {
return element.hasOwnProperty(pre) && Boolean(element[pre]);
});
}
I was using Chrome as a browser in a ubuntu 20 machine