title: How to check if an HTMLCollection contains an element with a given class name using javascript?
body: <p>Hi i am new to programming and i want to access the array inside an object using javascript...</p>
  
  <p>i have the datastructure like below,</p>
  
  <pre><code>const some_obj = {
      accessKey: "",
      children: [
          div.someclassname,
          div.someclassname,
          div.someclassname.highlight,
      ]
  }
  </code></pre>
  
  <p>Below is what it looks like in browser console when i log the variable.</p>
  
  <pre><code>object
  current: div.wrapper
      accessKey: ""
      align: ""
      childElementCount: 4
      childNodes: NodeList(4) [div.someclassname, div.someclassname.highlight, 
      div.someclassname]
      children: HTMLCollection(4) [div.someclassname, 
      div.someclassname.highlight, div.someclassname]
  </code></pre>
  
  <p>printing some_obj.children in the console gives below output.
      object.children 
      HTMLCollection(3)
      0: div.someclassname
      1: div.someclassname.highlight
      2: div.someclassname</p>
  
  <p>Now from the some_obj i want to check if some_obj has div.classname.highlight in children array. how can i do it.</p>
  
  <p>i tried using
      some_obj.current.children.find() but says find is not a function.</p>
  
  <p>how can i check if the some_obj children has the div.someclassname.highlight. could someone help me fix this.thanks</p>