Thanks to visit codestin.com
Credit goes to github.com

Skip to content

copyWithIn() with Array-like #20

@azu

Description

@azu

Currently, following behavior.

import { copyWithin } from "@immutable-array/copyWithin";
const arrayLike = { length: 5, 3: 1 };
let actual = copyWithin(arrayLike, 0, 3);
assert.deepStrictEqual(actual, [1, , , 1,]);

Native Array#copyWithIn() work following:

[].copyWithin.call({length: 5, 3: 1}, 0, 3);
// {0: 1, 3: 1, length: 5}

It return just array-like object.

Is this no problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions