Guest User

Untitled

a guest
Apr 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. itemClasses() {
  2. let result = [];
  3. let score = Math.floor(this.score * 2) / 2;
  4. let hasDecimal = score % 1 !== 0;
  5. let integer = Math.floor(score);
  6. for (let i = 0; i < integer; i++) {
  7. result.push(CLS_ON);
  8. }
  9. if (hasDecimal) {
  10. result.push(CLS_HALF);
  11. }
  12. while (result.length < LENGTH) {
  13. result.push(CLS_OFF);
  14. }
  15. return result;
  16. }
Add Comment
Please, Sign In to add comment