I am very new to javascript and i've been trying to make a simple function that calculates the total amount of money i spend in a week depending on the money i spend every day but i keep getting the error: Uncaught ReferenceError: numdays is not defined
var amount=calculateamount(7,20);
function calculateamount(numdays, avgmoney)
{
return numdays*avgmoney;
}
I found the mistake but i have another question. How do i use the Number function and the isNaN function in the code? Is it like this?
return numdays*avgmoney;
isNaN(calculateamount(numdays, avgmoney));