properties with the same name and different type in Javascript
<p>Can I have a property and a method with the same names and different types in an object like below in JavaScript?</p>

<pre><code>var o = {};
o.sample = {
  x : 10,
  y : 20 }

o.sample = function() {
  return this.sample.x + this.sample.y
}
</code></pre>
