'use strict';
console.log('Задача: найти корни уравнения x2 − 2x − 3 = 0');
const findDiscriminante = (a, b, c) => b * b - 4 * a * c;
const findXY = (a, b, c) => {
let discriminante = findDiscriminante(a, b, c);
let XY = [];
XY.push(-b + Math.sqrt(discriminante) / 2 * a);
XY.push(-b - Math.sqrt(discriminante) / 2 * a);
return XY;
}
const [x, y] = findXY(1, -2, -3);
console.log(`Ответ: ${x}, ${y}`);