immutable-array-prototype icon indicating copy to clipboard operation
immutable-array-prototype copied to clipboard

copyWithIn() with Array-like

Open azu opened this issue 8 years ago • 0 comments

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?

azu avatar Jun 24 '17 06:06 azu