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:
parent
9e05672f87
commit
97cd1173fa
3 changed files with 36 additions and 0 deletions
12
Libraries/LibJS/Tests/String.prototype.indexOf.js
Normal file
12
Libraries/LibJS/Tests/String.prototype.indexOf.js
Normal 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue