string-methods answer is incorrect
senocular opened this issue · 2 comments
senocular commented
Describe the bug
Answer specified in string-methods is incorrect. The correct answer is marked as "search" but should be "indexOf". search finds the index of a regular expression, not a string (if a string is given, it will be converted to a regex). When finding a string you would use indexOf.
To Reproduce
Steps to reproduce the behavior:
- Go to https://quiz.typeofnan.dev/string-methods/
- Click on indexOf
- Click on Submit
Expected behavior
Answer is correct.
nas5w commented
Whoops, I merged a fix before you could do yours. I actually removed search
altogether because it coincidentally does work in this scenario. Maybe it's worth a separate question emphasizing the difference between the two?