var text = ['BASIC', 'STANDART', 'ADVANCED'];
const inputs = document.querySelectorAll('input[name="rate"]');
inputs.forEach((item) => {
item.addEventListener('change', function () {
const {value} = this;
if (value == 1) {
document.getElementById('result').innerHTML = text[0];
} else if (value == 2) {
document.getElementById('result').innerHTML = text[1];
} else if (value == 3) {
document.getElementById('result').innerHTML = text[2];
}
});
});
(\d*,\d{2})
bottom:0;
rigth:0;
const getRandomNumber = (min, max) => {
return Math.floor(Math.random() * (max - min)) + min;
};
const startNum = getRandomNumber(1, 100);
const progrStep = getRandomNumber(1, 10);
const progrCount = 10;
const str = [];
for (let i = startNum; i < startNum + progrCount * progrStep; i += progrStep) {
str.push(i);
}
str[getRandomNumber(0, 9)] = '..';
console.log(str.join(' '));
function putSpacesNumber(number) {
if (typeof number !== 'number') {
throw new TypeError('Argument must be a number');
}
if (number < 1000) {
return number;
}
const arr = number.toString().split('');
const result = [];
const lengthdivineby3 = arr.length % 3;
if (lengthdivineby3) {
result.push(arr.slice(0, lengthdivineby3).join(''));
}
for (let i = lengthdivineby3; i < arr.length; i += 3) {
result.push(' ', arr.slice(i, i + 3).join(''));
}
return result.join('').trim();
}