1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Apply Multiple CSS-in-JS Arguments in a JavaScript Mixin Function with the Rest Operator

    javascriptJavaScript

    The rest operator in JavaScript allows us to 'collect' arguments dynamically in one variable similar to SCSS variable arguments

    This is useful for CSS-in-JS when you have CSS properties like box-shadow that can attach multiple shadows to a single element. With the rest operator, you'll be able to add all the shadows you want to a single argument for use in a JavaScript CSS mixin function.