mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:37:45 +00:00
LibJS: Use "," separator in Array.prototype.join() if first arg is undefined
This is how the spec describes it, not "if the first arg is missing". Also swap length & separator steps to match spec.
This commit is contained in:
parent
3e0e84dcd1
commit
e5845ba3a0
2 changed files with 5 additions and 4 deletions
|
@ -4,6 +4,7 @@ test("length is 1", () => {
|
|||
|
||||
test("basic functionality", () => {
|
||||
expect(["hello", "friends"].join()).toBe("hello,friends");
|
||||
expect(["hello", "friends"].join(undefined)).toBe("hello,friends");
|
||||
expect(["hello", "friends"].join(" ")).toBe("hello friends");
|
||||
expect(["hello", "friends", "foo"].join("~", "#")).toBe("hello~friends~foo");
|
||||
expect([].join()).toBe("");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue