Полезные маленькие скрипты
Math.sqrt(122.4435)
n % 1 === 0
~~n === n
Math.floor(n) === n
Math.trunc(n) === n
Number.isInteger(n)
n = Math.sqrt(154.23435)
Math.trunc(n)
~~n
Math.abs(n)
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}