Has every tag
A JavaScript exercise from Scriptdrill. Solve it with a code editor in your browser that runs your function against example and hidden tests, and it is checked the moment you submit.
The task
Return `true` when every string in `required` appears in `tags`, otherwise `false`. Matching is case-sensitive, and an empty `required` list is always satisfied.
What this exercise teaches
every stops at the first required tag that is missing. includes compares with strict equality, so case matters, and repeated required tags are simply checked again.
A hint if you get stuck
`every` checks that a test holds for all items of an array, and `includes` checks whether an array contains a value. `every` on an empty array returns true.
Try it now, no account needed
This exercise is free. Open it on the practice page, solve it, and get instant feedback with a hint and a worked solution after two tries.
Open this exercise