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