const calculate = (min, max) => Math.floor(Math.random() * (max - min) + min);
const numA = calculate(1, 20);
const numB = calculate(1, 20);

function Main(numA, numB)
{
  let result = -1;

  if (numA < 9 && numB < 9)
  { 
    result = numA * numB;
  }
  
	//出力
  console.log(result);
}
Main(numA, numB);