Why regular judgment should be made by adding class method to JavaScript Native

hasClass function what is the purpose here

Mar.20,2021

means that if the element already has this class, don't add it again.

Menu