passing an array to a function
/**
* myFunction - receives an array param of 10 int variables
*/
void myFunction(int param[10]) {
.
.
.
}
passing an array to a function
/**
* myFunction - receives an array param of 10 int variables
*/
void myFunction(int param[10]) {
.
.
.
}
javascript pass array by value
// example of pass array by value
let arr = [ 1 , 2 , 3 ];
// new Array => constructor take args & make array using it
// ...arr => just extract all array elements in this place
let arr_copy = new Array( ...arr ); // pass by value
arr_copy[0] = 99; // proof :)
console.log( arr ); // output => [ 1 , 2 , 3 ]
console.log( arr_copy ); // output => [ 99 , 2 , 3 ]
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