Skip to content

Commit

Permalink
chore: Update array.copyWithin method in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
manthanank committed Jul 1, 2024
1 parent d9d6e94 commit d500866
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,11 @@ console.log(array.constructor); // Output: ƒ Array() { [native code] }
```javascript
let array = ['a', 'b', 'c', 'd', 'e', 'f'];

array.copyWithin(0, 3, 5);
console.log(array); // Output: ["d", "e", "c", "d", "e", "f"]
array.copyWithin(2, 0);
console.log(array); // Output: ["a", "b", "a", "b", "c", "d"]

array.copyWithin(4, 0, 2);
console.log(array); // Output: ["a", "b", "a", "b", "a", "b"]
```
[Back to Top⤴️](#table-of-contents)
Expand Down

0 comments on commit d500866

Please sign in to comment.