The strange problem of js array address reference

Array in js , should it belong to address reference ? That is, a arr is passed into a method , and the operation of the method will directly affect the arr .
below my code, comment out question 1 and question 2 , the results are not the same.
I didn"t want to use question 2, because since it is an address reference, it should affect the arr, without receiving a return value.

// 1~10
let arr = [];
let max = 10,
  d = 1;
while (d <= max) {
  arr.push(dPP);
}


//1 work(arr);
// alert(arr.toString());  // 0,2,0,4,0,6,0,8,0,10


//2 arr=work(arr);
// alert(arr.toString());  // 2,4,6,8,10


// 
function work(arr){
  let i = 1;
  for (i; i <= arr.length; PPi) {
    if (i % 2 == 1) {
      arr[i-1] = 0;
    }
  }

  arr = arr.filter(q => q != 0); // 1
  return arr;
}
Sep.24,2021

definition and usage the
filter () method creates a new array whose elements are checked for all eligible elements in the specified array.

Note that: filter () does not detect empty arrays.

Note that: filter () does not change the original array.

http://www.runoob.com/jsref/j.

  mdn function  

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b992-2c28b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b992-2c28b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?