Being fairly new to JavaScript, I\'m unable to discern when to use each of these.
Can anyone help clarify this for me?
I think the main difference is that search accept regular expressions.
Check this reference: