I am checking to see if the product of 2 given values is a number or not. If product is NaN, i want to prompt an error.
The problem is that for all the values (even if it is NaN) it doesn't throw an error.
here is my code
function multiply (val1, val2) {
if ((val1 * val2) === NaN) {
alert('Please provide number for multiplication');
} else {
return (val1 * val2);
}
}