I came around a method to merge objects
Object.assign({a:1,b:2},{c:3,d:4})
Result is
{a:1,b:2,c:3,d:4}
Now I have a Video DOM Object which have properties like currentTime,duration
So I wanted to merge DOM Video Object with a simple object like this
Object.assign(videoElement,{www:1})
Result is not what I wanted , sometimes its only the video element and sometimes its {www:1}
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
Object.assign(ConvertToObject(videoElement),{www:1})
So I could create a new object having properties of my own object and video dom element properties
Thanks in advance and If you vote down please let me know why