🔥 If you are trying to add/remove multiple classes from an element, an array spread is the perfect use case here since classList.remove() requires multiple arguments.

Instead of it passing in 1 array arg, it passes each item of the array as a separate argument

🔥 If you are trying to add/remove multiple classes from an element, an array spread is the perfect use case here since classList.remove() requires multiple arguments.

Instead of it passing in 1 array arg, it passes each item of the array as a separate argument

Syntax Podcast

Hold on — I'm grabbin' the last one.

Listen Now →
Syntax Podcast

@wesbos Instant Grams

Beginner JavaScript

Beginner JavaScript

A fun, exercise heavy approach to learning Modern JavaScript from scratch. This is a course for absolute beginners or anyone looking to brush up on their fundamentals. Start here if you are new to JS or programming in general!

BeginnerJavaScript.com
I post videos on and code on

Wes Bos © 1999 — 2024

Terms × Privacy Policy