JSFiddle - React, Tailwind, and code Playground
by David Hughes
JavaScript
function every(collection, pre) {
// Is everyone being true?
// Does each element in first argument have the second argument as a property
console.log(collection[0].hasOwnProperty(arguments[1]));
console.log(arguments[1]);
return pre;
}
every([
{"user": "Tinky-Winky", "sex": "male"},
{"user": "Dipsy", "sex": "male"},
{"user": "Laa-Laa", "sex": "female"},
{"user": "Po", "sex": "female"}
],
"sex");