Usage: Assign the function to something, eg. var stars = function(a,b,c,d){ ... }
The function takes a floating point value and turns it into a "star" array. For example:
stars(2.5) => [2,2,1,0,0]
stars(3.8) => [2,2,2,2,0]
In these arrays, 2 = full star, 1 = half-star, 0 = no star. The function also takes an optional second argument which you can use to determine the amount of stars (default is 5). Like so:
stars(7.4,10) => [2,2,2,2,2,2,2,1,0,0,0]
This function can be useful if you want to display a star rating where each star is an individual element and you want half-stars as well.
lotta space left, you should try rendering the stars!