Very new programmer, trying to make a quadratic equation solver in javascript.
//QuadSolver, a b c as in classic ax^2 + bx + c format
function quadsolve(x, a, b, c) {
var sol = (
((a * (x * x)) + (b * x)) + c
)
}
//Test
console.log(quadsolve(1, 1, 1, 0))
In the console, it outputs "undefined". Would this be the correct way to go about solving the problem? If so, how would I get a value instead of undefined? Thanks!