Skip to main content

Practice · 1 of 2

Dedupe and Membership with Set

CHALLENGE
Difficulty: intermediate+25 XP

Write dedupeTags(tags) that returns the unique tags of an array, preserving first-seen order, case-insensitively ("CSS" and "css" are the same tag; keep the first spelling seen). Also write hasAll(tags, needed) returning true only if every string in needed appears in tags.

Back to lesson: Practice: Choosing Structures — Practice