How best to convert a ClientRect / DomRect into a plain Object
<p>The result of <code>someElement.getBoundingClientRect()</code> returns a <em>special</em> object of type <code>ClientRect</code> (or <code>DomRect</code> apparently)</p>

<p>It is structured like <code>{top: 10, right: 20, bottom: 30, left: 10, width: 10}</code></p>

<p>Unfortunately, this object does not behave quite like other objects.</p>

<p>For example, using <code>Object.keys</code> on it returns an empty array (I think because <code>ClientRect</code> properties are not <em>enumerable</em></p>

<p>I found something of a dirty way to convert to a plain object:</p>

<pre><code>var obj = {}
for (key in rect) {
  obj[key] = rect[key]
}
</code></pre>

<p>My question is, <strong>is there a better way?</strong> </p>