// Типизируй функцию
 
function rollDice(): 1 | 2 | 3 | 4 | 5 | 6 {
  return Math.floor(Math.random() * 6) + 1;
}

**Ответ

function rollDice(): number {
  return Math.floor(Math.random() * 6) + 1;
}
 
console.log(rollDice());

Назад