alternative to indexOf in Javascript
indexof, javascript
Solution
.search()?
"this is test for alternative".search("for")
>> 13
Problem
I have string as `this is test for alternative`. What I want to find is location of `for`. I know I could have done this using `alert(myString.indexOf("for"))`, however I don't want to use `indexOf`. Any idea/ suggestion for alternative? jsfiddle Again, I need this done by Javascript only. No jQuery.. sadly :(