1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:07:35 +00:00

LibJS: Add Array.prototype.join()

And share the code with Array.prototype.toString() :^)
This commit is contained in:
Andreas Kling 2020-04-15 10:06:01 +02:00
parent fa30355194
commit ad2aac5fde
3 changed files with 41 additions and 8 deletions

View file

@ -0,0 +1,13 @@
load("test-common.js");
try {
assert(Array.prototype.push.length === 1);
assert(["hello", "friends"].join() === "hello,friends");
assert(["hello", "friends"].join(" ") === "hello friends");
assert(Array(3).join() === ",,");
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}