mirror of
https://github.com/mue/mue.git
synced 2026-07-19 06:54:10 +02:00
Codacy
This commit is contained in:
@@ -123,4 +123,4 @@ module.exports = class Message {
|
||||
else if (hour > 18) time = 'Dod eftermiddag'; // If it's before 6pm, set the time string to "Good afternoon"
|
||||
setHTMLContent('.greeting', time); // Write the string contents to the HTML
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -20,22 +20,22 @@ module.exports = class Util {
|
||||
// format time
|
||||
static formatTimeUnit(unit) {
|
||||
return unit < 10 ? '0' + unit : unit;
|
||||
};
|
||||
}
|
||||
|
||||
// setHTMLContent is the kind of function that is referred to as a 'wrapper'
|
||||
static setHTMLContent(selector, content) {
|
||||
return document.querySelector(selector).innerHTML = content;
|
||||
};
|
||||
}
|
||||
|
||||
// get random item
|
||||
static getRandIndex(array) {
|
||||
return Math.floor(Math.random() * (array.length - 1));
|
||||
};
|
||||
}
|
||||
|
||||
// pick random from array
|
||||
static pickFromArray(array) {
|
||||
return array[Math.floor(Math.random() * (array.length - 1))];
|
||||
};
|
||||
}
|
||||
|
||||
static contains(needle) {
|
||||
let findNaN = needle !== needle;
|
||||
|
||||
Reference in New Issue
Block a user