feat: Move function to app scope
- Move randomIntFrom() to app.js - Add global entry to jshint configuration
This commit is contained in:
parent
148f4e0a21
commit
ddbd406fc8
3 changed files with 20 additions and 18 deletions
|
|
@ -272,24 +272,6 @@ function loadCore() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt eine Zahl zwischen <min> und <max> aus.
|
||||
* Die Werte <min> und <max> sind dabei mit eingeschlossen.
|
||||
* Mit <pos> kann der Exponent für eine 10er-Teilung angegeben werden.
|
||||
*
|
||||
* @param {number} min
|
||||
* @param {number} max
|
||||
* @param {number} pos
|
||||
* @returns {number}
|
||||
*/
|
||||
function randomIntFrom(min, max, pos = 0) {
|
||||
pos = Math.pow(10, pos);
|
||||
min = Math.ceil(min);
|
||||
max = Math.floor(max);
|
||||
|
||||
return Math.floor((Math.random() * (max - min + 1) + min) / pos) * pos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Erstellt Kontext für hint-Objekt und ermöglicht das Entfernen des Ereignis.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue