In jQuery, is it recommended to check if a class is already assigned to an element before adding that class? Will it even have any effect at all?
For example:
A simple check in the console would have told you that calling addClass multiple times with the same class is safe.
addClass
Specifically you can find the check in the source
if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { setClass += classNames[ c ] + " "; }