Can someone help me with this coding project
And sorry for the bad quality

Answer:
PART 1
if (isNan(num1) || isNan(num2)){
throw 'Error';
}
PART 2
catch(e){
document.getElementById("answer").innerHTML = "Error!";
}