
array.copyWithin() – Copies part of the array to another location within the same array, without changing its length.
๐ Syntax
array.copyWithin(target, start = 0, end = array.length);
๐งช Example
[1,2,3,4].copyWithin(1,0,2); // [1,1,2,4]
array.copyWithin() – Copies part of the array to another location within the same array, without changing its length.
array.copyWithin(target, start = 0, end = array.length);
[1,2,3,4].copyWithin(1,0,2); // [1,1,2,4]
Comments
Post a Comment