Здесь я пытаюсь вычислить и сохранить количество файлов cookie, умноженное на avgCookiePerSale и сгенерированный номер потребителя, который является свойством клиента, поэтому я хочу распечатать по openHours, назначенным с помощью avgCookies в пустом массиве в HTML, как это сделать, я напортачил, знаю?
Пожалуйста, объясните простыми словами, потому что я совсем новичок.
'use restrict'
var seattle = {
location: 'seattle',
minCustPerHour: 23,
maxCustPerHour: 65,
avgCookiePerSale: 6.5,
customer: 0,
avgCookies: 0,
array: [],
openHours: ['6 AM ', '7 AM ', '8 AM ', '9 AM ', '10 AM ', '11 AM ', '12 PM ', '1 PM ', '2 PM ', '3 PM ', '4 PM ', '5 PM ', '6 PM ', '7 PM '],
setRandomNoCustPerHour: function(maxValue, minValue){
this.customer = generateRandomCustNo(this.maxCustPerHour, this.minCustPerHour);
},
// avgCookies = cutomer * avgCookiePerSale == 6am
render: function(){
var parentElement = document.getElementById("Yolo");
var article = document.createElement('article');
parentElement.appendChild(article);
var RandomNo = document.createElement('h3');
RandomNo.textContent = this.avgSales;
article.appendChile(RandomNo);
var ul = document.createElement('ul');
article.appendChild('ul');
for (let index = 0; index <= this.openHours.length; index++) {
avgCookies[index] = customer*avgCookiePerSale;
this.array.push(customer*avgCookiePerSale);
}
},
};
console.log(this.array);
//method
function generateRandomCustNo (maxValue,minValue){
var generateNo = (Math.floor(Math.random()*maxValue-minValue+1))+minValue;
return generateNo;
}
seattle.setRandomNoCustPerHour(65,23);
// seattle.render();
console.log(seattle.customer);
// console.log(this.avgSales)
// console.log(render);