Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    I couldn't find it in w3schools, that's why I wrote it. w3schools.com/jsref/jsref_obj_array.asp Does it take a from parameter btw?
    – Amarghosh
    Commented Oct 18, 2009 at 8:51
  • Thanks @Gumbo and @meder - gonna change my bookmarks now. I'm yet to do anything serious in js and I use w3schools for casual reference (that's all I've ever needed) - may be that's why I didn't realize that.
    – Amarghosh
    Commented Oct 18, 2009 at 9:15
  • MDC says indexOf requires javascript 1.6 Would it be safe to assume that the common browsers (>= FF2, > IE6 etc) would support it?
    – Amarghosh
    Commented Oct 18, 2009 at 9:19
  • 4
    IE6 doesn't support Array.prototype.indexOf, just paste the support method given by Mozilla so IE doesn't throw an error. Commented Oct 18, 2009 at 9:37
  • updated using indexOf. Cleaned up the code by removing commented part. @meder - thanks again.
    – Amarghosh
    Commented Oct 18, 2009 at 9:49