Datatables data binding problem

The data in

data can be displayed if it is written as dataa, but if the value of the request in the background is datab, and datab is assigned to dataa, it cannot be bound, saying that the data in the table is empty:

var arr1=[];
function comTable(){
    var j = 1;
    var q = 1; 
    var glUrl="http://XXXXXXXXXX9001/screenController.htm?param_act=getLastMothReport";
    $.getJSON(glUrl+"&callback=?", function(data){
        //console.log(data);
        console.log("1q");
        arr1 = Object.keys(data.reportdata).map((k, i) => {
            return [i, k, ...data.reportdata[k]];
        });
    });
};
comTable();
dataa=arr1;
Mar.05,2021
There are some problems with the

request code. Ajax is asynchronous , so when the last dataa=arr1; assignment is executed, the data that may be requested is not returned.

Menu