This question has already been answered:
- OOP javascript 3 replies
function calcD(a, b, c) { return b*b - 4*a*c; } calcD(-4, 2, 1); alert(calcD()); Why did the function display NaN according to the idea, as I understand it, it should output a number?
function calcD(a, b, c) { return b*b - 4*a*c; } var test = calcD(-4, 2, 1); alert(test); // 20 But how did you get the number?