preUpdate
.push()
по умолчанию), свежесозданный Embedded объектик типа записи лога событий.onFlush
, и только потом preUpdate
, создающий в классе «задания» для последующего обновления. data
и есть объект. Вместо этого вам нужны три строкиcountry, region_with_type, city_with_type
document.getElementById('information').innerHTML = [country, region_with_type, city_with_type].join('<br>');
const distribution = total => {
const result = Array(10).fill(0);
while (total--) result[Math.floor((Math.random() * 99) / 10)]++;
return result;
}
distribution(100000) // [ 10293, 10053, 10155, 10087, 10191, 10059, 10054, 9976, 10134, 8998 ]
distribution(3) // [ 0, 0, 1, 2, 0, 0, 0, 0, 0, 0 ]