[Solved] How to return the array variables values to another function on javascript?


My suggestion for you: free code camp

function getPassedUsers() {
    var rr = ["a", "b"];
    var xx = ["c"];

    return {
        rr: rr,
        xx: xx,
    };
}

function ABC() {
    var data = getPassedUsers();
    console.log(data.rr);
    console.log(data.xx);
    // you should first call `getPassedUsers` function
    // so `getPassedUsers` generate that data and return it for you
    // and you will save it in `data` var
    // if you want data from `getPassedUsers` you should call it first
}

solved How to return the array variables values to another function on javascript?