Build an All-True Property Validator - Build an All-True Property Validator

Tell us what’s happening:

Any possible solution I got stuck for hours, the instructions says we should test each function to return true/false.

``
function truthCheck(collection, pre) {
return pre;
}

truthCheck([{name: “Quincy”, role: “Founder”, isBot: false}, {name: “Naomi”, role: “”, isBot: false}, {name: “Camperbot”, role: “Bot”, isBot: true}], “isBot”);
``

Your code so far

function truthCheck(collection, pre) {
  return pre;
}

truthCheck([{name: "Quincy", role: "Founder", isBot: false}, {name: "Naomi", role: "", isBot: false}, {name: "Camperbot", role: "Bot", isBot: true}], "isBot");







Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36

Challenge Information:

Build an All-True Property Validator - Build an All-True Property Validator

Hi @anthonybassey

The function needs to check the property of every element in the collection.

To help debug / see what the function is returning, try placing the function call in a console log.

Happy coding

1 Like

Ok, I am going to try that however if it doesn’t work will get across. I did tried logged each to the console earlier it didn’t work.

First erase the code which show in console. Then write your function …..

MODERATOR Solution removed

It will pass all the test cases

1 Like

Welcome to the forum @Sahil8564

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

Happy coding

1 Like