Ad
  • Default User Avatar

    Hi there,

    Would someone please explain to me this test?
    "abcba".indexOf(/^c/, 2) - Expected: -1, instead got: 2.

    Per my understanding this should be checking the "cba" substring if it matches the /^c/ pattern.
    Since "cba" starts with "c" I don't understand, why should return not found (-1)

    Thank you!