I started my first project and it was going well, the Javascript was a quadratic equation solver that I tested and it said "document.write can be a form of eval." how can I fix this?
This is the javascript:
function solve(a, b, c) {
var result = (-1 * b + Math.sqrt(Math.pow(b, 2) - (4 * a * c))) / (2 * a);
var result2 = (-1 * b - Math.sqrt(Math.pow(b, 2) - (4 * a * c))) / (2 * a);
return result + "<br>" + result2;
}
document.write(solve(1, 1, -1));