Media strategist turned english teacher turned software engineer. American expat living abroad. I like building things that help people. I also like pies.
Ah yes, indexOf always starts at 0! Since I wanted to look at the beginning of string for the characters, this is a much shorter way to write out my search function. Thanks!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You can also use your initial
indexOf
way, but compare as=== 0
instead of!== 1
, unless I'm missing something.Ah yes, indexOf always starts at 0! Since I wanted to look at the beginning of string for the characters, this is a much shorter way to write out my search function. Thanks!