1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:57:44 +00:00

LibJS: Add String.prototype.indexOf()

This commit is contained in:
Andreas Kling 2020-04-04 23:44:29 +02:00
parent 9e05672f87
commit 97cd1173fa
3 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,12 @@
function assert(x) { if (!x) throw 1; }
try {
var s = "hello friends"
assert(s.indexOf("friends") === 6);
assert(s.indexOf("enemies") === -1);
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}