Hot to use the second parameter of lastIndexOf() method in javascript string object?
<pre><code>"This apple is my apple".lastIndexOf("apple"); // returns value of 17
"This apple is my apple".lastIndexOf("apple",12); // returns value of 5
"This apple is my apple".lastIndexOf("apple", 3); // returns value of -1, not found
</code></pre>

<p>Hi guys!</p>

<p>I understand the first two examples,but why the third doesn't return 5?</p>

<p>Like indexOf, lastIndexOf also takes an optional second parameter, which is an index
value of where to start the search, counted from the right</p>

<p>so the string 'apple' should match the position 5. But I still got the result of -1?</p>

<p>what's the problem?</p>
