I'm making a simple quadratic equation app, the user should enter a three number first: a, b and c.
The first step is checking if all input values are numbers, unfortunately, the function I wrote isn't working. How can I rewrite my function so it console.log 'Input valid data' if the input value is not a number.
Here is my code:
const a_number = parseFloat(prompt("Please, enter a-number", '0'));
const b_number = parseFloat(prompt("Please, enter b-number", '0'));
const c_number = parseFloat(prompt("Please, enter c-number", '0'));
console.log(a_number, b_number, c_number);
ValidInput(a_number, b_number, c_number);
function ValidInput (a, b, c) {
if (a || b || c) {
return
} else {
console.log('Invalid input data');
}
}
Arraymethods likeevery.