title: How exactly does element.classList.contains() work in JavaScript?
body: <p>I needed to use <code>element.classList.contains('some-class')</code> to check if an element contains at least one of three classes, so I wrote:</p>
  
  <pre><code>if (element.classList.contains('class1', 'class2', 'class3')) {
    // do stuff here
  }
  </code></pre>
  
  <p>The result was - if the element has 'class1', it returns true, no matter if it has 'class2' or/and 'class3', and 
      <code>// do stuff here</code>
  executes. However, if it has 'class2' and/or 'class3', it returns false and
      <code>// do stuff here</code>
  does not execute.</p>
  
  <p>I worked around it with:</p>
  
  <pre><code>if (element.classList.contains('class1') || element.classList.contains('class2') || element.classList.contains('class3')) {
    // do stuff here 
  }
  </code></pre>