Why can't I pass str.indexOf to map in javascript
<p>Why can't I do the following?</p>

<pre><code>var str = "A string with * and ^ and even $";
var indeces = ["*", "^", "$"].map(str.indexOf); // doesnt work
</code></pre>

<p>I'd rather not pass in another function to do the exact same thing as the method itself...</p>

<pre><code>[...].map(function(token) { return str.indexOf(token); }); // works
</code></pre>

<p>Is there an elegant way to do this?</p>
