Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const numbers = [1, 2, 3] // Array
// Normal Method
const newArray = numbers.slice()
console.log(newArray) // [1, 2, 3]
// Another Method
const anotherNewArray = Array.prototype.slice.call(numbers)
console.log(anotherNewArray) // [1, 2, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.