Everything be true

When I read the problem I was given on freecodecamp I wasn’t sure what to us inoder to complete the challenge but I could understand that I need to check if the second argumet is true.

Problem

Check if the predicate (second argument) is truthy on all elements of a collection (first argument). Remember, you can access object properties through either dot notation or [] notation.

Approach

I went and googled about truthy and falsy, I got more understanding about them and I attempted the problem. I had a for-loop which will iterate through the first array with objects inside and an If-statement to check which index is in same position with the second object if not the same, which return false and if it is should return true.

Conclusion

It was an interesting challenge because I got a revision about truthy and falsy and it became clear when I read more.