Answers for "rating calculator formula javascript"

0

rating calculator formula javascript

var stars = [0, 0, 2, 3, 5],
    count = 0,
    sum = 0;

stars.forEach(function(value, index){
  count += value;
  sum += value * (index + 1);
});

console.log(sum / count);
Posted by: Guest on September-09-2021

Code answers related to "rating calculator formula javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language