String.prototype.indexOf.js 189 B

12345678910
  1. try {
  2. var s = "hello friends"
  3. assert(s.indexOf("friends") === 6);
  4. assert(s.indexOf("enemies") === -1);
  5. console.log("PASS");
  6. } catch (e) {
  7. console.log("FAIL: " + e);
  8. }