CSS: Skip falsy values in `addClass( array )`, compress code
commita338b407f2479f82df40635055effc163835183f
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Mon, 24 Jan 2022 17:56:49 +0000 (24 18:56 +0100)
committerGitHub <noreply@github.com>
Mon, 24 Jan 2022 17:56:49 +0000 (24 18:56 +0100)
treebe2a2f2b68d74a716388ea0027ff4083e000bfc9
parent9c6f64c7b51d50e334ef1183e2937ad77c0a68b0
CSS: Skip falsy values in `addClass( array )`, compress code

This change makes jQuery skip falsy values in `addClass( array )`
& `removeClass( array )` instead of stopping iteration when the first falsy
value is detected. This makes code like:
```js
elem.addClass( [ "a", "", "b" ] );
```
add both the `a` & `b` classes.

The code was also optimized for size a bit so it doesn't increase the
minified gzipped size.

Fixes gh-4998
Closes gh-5003
src/attributes/classes.js
test/unit/attributes.js