Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pointInRectangle(input) {
- let x1 = Number(input.shift());
- let y1 = Number(input.shift());
- let x2 = Number(input.shift());
- let y2 = Number(input.shift());
- let x = Number(input.shift());
- let y = Number(input.shift());
- if ((y >= y1) && (y <= y2) && (x >= x1) && (x <= x2)) {
- console.log("Inside");
- } else {
- console.log("Outside");
- }
- }
- pointInRectangle([-1, -3, 4, 1, 0.5, 1]);
Advertisement
Add Comment
Please, Sign In to add comment