const x1 = 0.0, y1 = 0.0;
const x2 = 7.0, y2 = 7.0;
const x = 3.0, y = 2.0;
const pointInRect = ({x1, y1, x2, y2}, {x, y}) => (
x >= x1 && x <= x2 && y >= y1 && y <= y2
);
const rect = { x1, y1, x2, y2 };
const point = { x, y };
if (pointInRect(rect, point)) {
console.log("The point is inside the rectangle.");
} else {
console.log("The point is outside the rectangle.");
}
/*
run:
The point is inside the rectangle.
*/