Вы не назначаете результаты функции переменным.
Ваши функции должны return
результат, а не console.log
it.
Вам нужно позвонить joinNums()
(вы, похоже, не).
Итак (см. ***
):
// random number between specified params
function randInteger() {
let min = 1;
let max = 10;
const randomInteger = Math.floor(Math.random() * (max - min + 1)) + min;
return randomInteger; // ***
}
function randDecimal() {
let decimal = 100;
let integral = 100;
const randomDecimal =
Math.floor(
Math.random() * (integral * decimal - 1 * decimal) + 1 * decimal
) /
(1 * decimal);
return randomDecimal; // ***
}
function joinNums() {
let randomDecimal = randDecimal(); // ***
let randomInteger = randInteger(); // ***
console.log(`${randomDecimal}${randomInteger}`);
}
joinNums(); // ***
Или, конечно, вы можете просто вызывать их напрямую, а не записывать в переменные сначала:
function joinNums() {
console.log(`${randDecimal()}${randInteger()}`); // ***
}
// random number between specified params
function randInteger() {
let min = 1;
let max = 10;
const randomInteger = Math.floor(Math.random() * (max - min + 1)) + min;
return randomInteger; // ***
}
function randDecimal() {
let decimal = 100;
let integral = 100;
const randomDecimal =
Math.floor(
Math.random() * (integral * decimal - 1 * decimal) + 1 * decimal
) /
(1 * decimal);
return randomDecimal; // ***
}
function joinNums() {
console.log(`${randDecimal()}${randInteger()}`);
}
joinNums(); // ***