Published Feb 12 2019
Psssst! The 2023 WEB DEVELOPMENT BOOTCAMP is starting on FEBRUARY 01, 2023! SIGNUPS ARE NOW OPEN to this 10-weeks cohort course. Learn the fundamentals, HTML, CSS, JS, Tailwind, React, Next.js and much more! ✨
Return the position of the first occurrence of the string passed as parameter in the current string.
It returns the index of the start of the occurrence, or -1 if no occurrence is found.
You can search using a regular expression (and in reality, even if you pass a string, that’s internally and transparently used as a regular expression too).