Excellent! Muffin can see how much the actual traffic is different from the planned one. Bu watching traffic using the method of unfaltering gaze is unscientific and inefficient. It is better to invoke dry statistics, which will help us understand what is going wrong in a non-obvious situation.
Now you need to add to the program the average number of visits for the observed period. If this value is below the recommended one, Muffin will have to think about increasing his traffic.
The average value is calculated using the formula: sum of all values divided by their number. Let’s calculate the average number of visits per day and log this value in the console.
var expectedUsers = 1000;
var firstDayUsers = 812;
var secondDayUsers = 1360;
var thirdDayUsers = 657;
// Drawing the traffic graph
keks.plot(firstDayUsers, secondDayUsers, thirdDayUsers, expectedUsers);
The code has changed, click “Run” or turn autorun on.
Calculate the average site traffic.
Add declaration of the variable averageUsers to the end of the program.
And assign it a value calculated using the formula (firstDayUsers + secondDayUsers + thirdDayUsers) / 3.
Then log the variable averageUsers in the console.
Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.
Forgot to connect your email to the profile? Email us and we’ll help.