All challenges
JavaScript challenge · Frontend
Classnames
Difficulty
easy
Time
~15m
Format
Single
Grading
Auto-graded
#frontend#javascript#typescript#strings#objects
Mission file // read carefullyeasy
Implement classNames(...args) — the classic conditional class joiner. Accept strings, numbers, arrays (recursively), and objects ({ cls: boolean }). Ignore falsy values. Return a space-separated string.
classNames('a', { b: true, c: false }, ['d']) // => 'a b d'
Build with
TypeScriptJavaScript
Hidden test suite
Auto-graded on submit
Start challenge
Sign in to save your progress.