No, they are same only with one case. If value not found InStr return 0 and indexOf return -1, but Instr has many other, have a look on
Differences
The InStr function returns the position of the first occurrence of one string within another.
The InStr function can return the following values:
If string1 is "" - InStr returns 0
If string1 is Null - InStr returns Null
If string2 is "" - InStr returns start
If string2 is Null - InStr returns Null
If string2 is not found - InStr returns 0
If string2 is found within string1 - InStr returns the position at which match is found
If start > Len(string1) - InStr returns 0
Whereas javascript indexOf()
method returns the position of the first occurrence of a specified value in a string.
This method returns -1 if the value to search for never occurs.