Let's say i have a range of numbers, for example : `5 to 8`

Then i have an array of existing ranges :

```
let arrayOfExistingRanges = [
  { 
   id: 1, 
   start: 1, 
   end: 2 
  },
  { 
   id: 2, 
   start: 1, 
   end: 5 
  },
  { 
   id: 3, 
   start: 5, 
   end: 6 
  },
  ...
]

```

I want to make sure that i don't overwrite/overlap any existing range with my new range.

Basically getting each objects of my `arrayOfExistingRanges` where my range is overlapping them in any way.

Below i made a list of possibilities to check against, but i would like to know if there would be a better way than to check individually each possibility..

[![enter image description here](https://i.stack.imgur.com/ZUs3g.png)](https://i.stack.imgur.com/ZUs3g.png)