Create javascript property like C# property
<p>Is it possible to create a property on a javascript object that behaves similar to a property in C#.</p>

<p>Example:
I've created an auto-sizing textarea widget using dojo.  In order to get the "value" property out of my widget, I've hooked up to the onchange event and I'm setting a variable everytime the value of the textarea changes.</p>

<p>Is there a way to accomplish this without hooking up to the onchange event.</p>

<p><b>Edit</b></p>

<p>In other words, is it possible to write something in JavaScript that behaves like getters and/or setters.</p>
