React copy array-Code Examples

Victor Talmacinschi

React copy array

JavaScript by Victor Talmacinschi June 16, 2022

const arr = [1, 2, 3];
const arr2 = arr.slice();
console.log(arr2);

0

13.572

React copy array

JavaScript by Victor Talmacinschi June 16, 2022

const arr = [1, 2, 3];
const arr2 = [...arr];
console.log(arr2);

0

13.572

Related JavaScript Queries

Latest JavaScript Queries

Explore code examples by categories