Converting int to enum
<p>I have an <code>object</code> and one of its properties is <code>object.type</code> when I return <code>object.type</code> it returns <code>2</code> but I would rather it return the enumeration of <code>2</code> for example <code>soft</code></p>

<pre><code>enum type {
    hard = 0,
    brittle,
    soft
};
</code></pre>
