 <blockquote> <p>I would like to set startAt as an number.</p> </blockquote> <p><code>SomeClass.prototype.startAt</code> <strong>is</strong> a number (<code>0</code>).</p> <p>Your <code>get</code> function explicitly returns <code>false</code> if the property is "falsey":</p> <pre><code>if(!this[prop]){return false;} </code></pre> <p>In JavaScript, <code>0</code>, <code>""</code>, <code>false</code>, <code>undefined</code>, and <code>null</code> are all "falsey", and so the condition above will be true and cause <code>get</code> to return <code>false</code>.</p> <p>If your goal is to return <code>false</code> if the property <em>doesn't exist</em>, you can do that like this:</p> <pre><code>if (!(prop in this)) { return false; } </code></pre> <p>That will check if the property exists on the object itself <em>or</em> its prototype, which I suspect is what you want. But if you only want to check the object itself and ignore properties on the prototype, that would be:</p> <pre><code>if (!this.hasOwnProperty(prop)) { return false; } </code></pre> <p>Bringing that all together, if your goal is for <code>get</code> to return <code>false</code> for properties that the object doesn't have (either its own, or via its prototype), then:</p> <pre><code>get : function(prop){ if (typeof prop !== "string" || !(prop in this)) { return false; } return this[prop]; } </code></pre> <p>I've done a few things there:</p> <ol> <li><p><code>typeof</code> is an operator, not a function, so you don't use parens around its operand (normally)</p></li> <li><p>Since <code>"undefined"</code> is <code>!== "string"</code>, there's no need to check for it specifically when checking that <code>prop</code> is a string.</p></li> <li><p>I used <code>!(prop in this)</code> to see if the object (or its prototype) has the property.</p></li> <li><p>I combined the two conditions that returned <code>false</code> into a single <code>if</code> statement using <code>||</code>.</p></li> </ol>