- script.js
JavaScript
var expectedUsers = 1000;
var firstDayUsers = 812;
var secondDayUsers = 1360;
var thirdDayUsers = 657;
// Drawing the traffic graph
muffin.plot(firstDayUsers, secondDayUsers, thirdDayUsers, expectedUsers);
// Calculating the average traffic value
var averageUsers = (firstDayUsers + secondDayUsers + thirdDayUsers) / 3;
console.log(averageUsers);
Result
Goalscompleted
Complete the program.
- Add a hint to the average value log in the console:
'Average traffic: ' + averageUsers
. - At the end of the program, add a check to make sure that the average value is greater than the expected one.
- If the condition is met, log the message in the console
'Traffic is amazing. Keep up the good work!'
. - Otherwise, log the following message in the console
'Traffic is so-so. You need to work harder!'
.
Comments