How to break reference between arrays in js

I have the function “analysis” doing lots of linear alegbra calculations in arrays,part of it is in the snippet below. However, when this function is called I want all the involved arrays to be empty so I call a function “varNeutral” that empties all the arrays. But, the arrays remain the same containing values from previous “analysis” run, causing large inaccuracy in the results. It is clear if one of the arrays remains all the rest don’t get cleared either. However I need to keep that array named “line” and only empty all the rest. Not only that I also fill them with zero but for example K contains values from previous analysis run regardless. Do you know how to solve this?

let line= [{x1:1, y1:1, x0:2, y0:2, m:2, l: 1.44, c: 1, s: 1, n1: 1, n2: 2,ea:2000,ca: 10}];
let numbNodes2      = [1,2]
  
function analysis(){
    varNeutral();
    RhA             = 8;
    let uniqueNode2 = [...line.map(a => a.n1) , ...line.map(a => a.n2)];
    for (var r = 0; r < 2*numbNodes2.length; r++){
        K[r] = [];
        M[r] = [];
        Kf[r]= [];
        C[r] = [];
        for (var c=0; c < 2*numbNodes2.length; c++) {
            K[r][c]  = 0;
            M[r][c]  = 0;
            Kf[r][c] = 0;
            C[r][c]  = 0;
        }
    }
    for (var r = 0; r<line.length; r++){
            KN1[r]                = 2*numbNodes2.indexOf(line[r].n1);
            KN2[r]                = 2*numbNodes2.indexOf(line[r].n2);
    }
    //k11 k22
    for (var r = 0; r<numbNodes2.length; r++){
        for (var mem = 0; mem<line.length; mem++) {
            if(line[mem].n1 == numbNodes2[r] || line[mem].n2 == numbNodes2[r]){
                let tmpl          = line[mem].l;
                let tmpc          = line[mem].c;
                let tmps          = line[mem].s;
                let tmpea         = line[mem].ea*canWidth/8;
                let tmpca         = line[mem].ca*8/canWidth;
                K[2*r][2*r]      += tmpea*Math.pow(tmpc,2)/tmpl;
                K[2*r][2*r+1]    += tmpea*tmps*tmpc/tmpl;
                K[2*r+1][2*r+1]  += tmpea*Math.pow(tmps,2)/tmpl;
                K[2*r+1][2*r]    += tmpea*tmps*tmpc/tmpl;  
                Kf[2*r][2*r]     += tmpea*Math.pow(tmpc,2)/tmpl;
                M[2*r][2*r]      += RhA*0.5*line[mem].l;
                M[2*r+1][2*r+1]  += RhA*0.5*line[mem].l;
                //
                C[2*r][2*r]      += tmpca*Math.pow(tmpc,2)*tmpl;
                C[2*r][2*r+1]    += tmpca*tmps*tmpc*tmpl;
                C[2*r+1][2*r+1]  += tmpca*Math.pow(tmps,2)*tmpl;
                C[2*r+1][2*r]    += tmpca*tmps*tmpc*tmpl;  
            }
        }
    } 
    KK = K;
 }

function varNeutral(){
    numbNodes2              =  [];
    KN1                     =  [];
    KN2                     =  [];
    K                       =  [];
    M                       =  [];
    Ka                      =  [];
    Kf                      =  [];
    Pa                      =  [];
    Ua                      =  [];
    Va                      =  [];
    KK                      =  [];
}