Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- itemClasses() {
- let result = [];
- let score = Math.floor(this.score * 2) / 2;
- let hasDecimal = score % 1 !== 0;
- let integer = Math.floor(score);
- for (let i = 0; i < integer; i++) {
- result.push(CLS_ON);
- }
- if (hasDecimal) {
- result.push(CLS_HALF);
- }
- while (result.length < LENGTH) {
- result.push(CLS_OFF);
- }
- return result;
- }
Add Comment
Please, Sign In to add comment