Rendering stars in JavaScript