The predicate is “sex”, of which we have 2 males and 2 females. We should return true ifall elements are the same (all male or all female), which they are not, hence the answer should be false no?
Since the elements of the array are objects and the predicate is a string the logical thing would be to chech if each object’s value evaluates to true or not. The exrcise doesn’t ask you to check if all values are equal.
because in javascript, All values are truthy unless they are defined as falsy (i.e., except for false, 0, “”, null, undefined, and NaN).
So as long as it exists and don’t have the values false, 0, null, undefined, and NaN then it will be true
otherwise, if it has one of those values it will be false.
Your code has been blurred out to avoid spoiling a full working solution for other campers who may not yet want to see a complete solution. In the future, please attempt to answer any question(s) posed by the OP instead of just posting a full working to a challenge.
It is much better if you can provide hints and suggestions to guide the OP in developing their own solution.