why javascript's charAt() with a string returns the first letter
<p>I am doing some exercises in my object-oriented javascript book, I notice that this:</p>

<pre><code>var a = "hello";
a.charAt('e'); // 'h'
a.charAt('adfadf'); //'h'
</code></pre>

<p>Why is the string in the argument seemingly evaluated to the integer 0 for the charAt() method for strings?</p>

<p>Edit: I was aware that the charAt()'s usage usually takes an integer, and the exercise feeds charAt() with a string, and I also was aware that the string is likely then to be coerced into an integer first, which I did verify to be NaN. Thanks Kendall, for suggesting putting this missing bit of information in the question proper</p>

<p>Thanks!</p>
