java copy array
int[] a = {1,2,3,4,5};
int[] b = Arrays.copyOf(a, a.length);
java copy array
int[] a = {1,2,3,4,5};
int[] b = Arrays.copyOf(a, a.length);
javascript copy array
var numbers = [1,2,3,4,5];
var newNumbers = Object.assign([], numbers);
javascript copy array
// this is for array with complex object
var countries = [
{name: 'USA', population: '300M'},
{name: 'China', population: '1.6B'}
];
var newCountries = JSON.parse(JSON.stringify(countries));
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us