title: Convert DOM Object to Javascript Object
body: <p>I came around a method to merge objects <br></p>
  
  <pre><code>Object.assign({a:1,b:2},{c:3,d:4})
  </code></pre>
  
  <p>Result is </p>
  
  <blockquote>
    <p>{a:1,b:2,c:3,d:4}</p>
  </blockquote>
  
  <p>Now I have a Video DOM Object which have properties like <strong>currentTime,duration</strong><br></p>
  
  <p>So I wanted to merge DOM Video Object with a simple object like this</p>
  
  <pre><code>Object.assign(videoElement,{www:1})
  </code></pre>
  
  <p>Result is not what I wanted , sometimes its only the video element and sometimes its {www:1}<br><br>
  <b>So I was wondering if there is any method to convert this DOM Video Object to javascript object so that I can merge it with simple javascript objects like this</b></p>
  
  <pre><code>Object.assign(ConvertToObject(videoElement),{www:1})
  </code></pre>
  
  <p>So I could create a new object having properties of my own object and video dom element properties<br>
  Thanks in advance and If you vote down please let me know why</p>