Use Array.map() instead of looping over elements and pushing the content to a new array

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2019-05-09 20:10:32 +02:00
committed by Mcat12
parent a4fe802fb9
commit cdefb1ca60
2 changed files with 2 additions and 20 deletions

View File

@@ -302,16 +302,7 @@ $(document).ready(function() {
"ajax": {
"url": APIstring,
"error": handleAjaxError,
"dataSrc": function(data){
var new_data = new Array();
for(obj of data.data)
{
obj[0] *= parseInt(1e6);
obj[0] += dataIndex++;
new_data.push(obj);
}
return new_data;
}
"dataSrc": function(data){ return data.data.map(function(x){ x[0] = x[0]*1e6+(dataIndex++); return x; }); }
},
"autoWidth" : false,
"processing": true,