I am passing an array to a function. Since, in javascript, arrays by default get passed by reference I tried to make a copy of array. But in the end, the operations performed in function effects the actual array data.
All I want to do is save the actual state of an array.
Here is my code :
let arrcopy =new Array( items.dt);
citem = binarySearch(arrcopy[0], ind.ItemID);