Is there any better way to rewrite this:
$(\'element\').removeClass(\'class1\').removeClass(\'class2\');
I cannot use removeC
Since jQuery 3.3.0, it is possible to pass arrays to .addClass(), .removeClass() and toggleClass(), which makes it easier if there is any logic which determines which classes should be added or removed, as you don't need to mess around with the space-delimited strings.
$("div").removeClass(["class1", "class2"]);