### prerequisite: node & npm install
### npm run test
expect result should be:
PASS test/rangelist.test.js
✓ range list add function (1 ms)
✓ range list remove function
✓ range list add & remove function
Test Suites: 1 passed, 1 total
Tests: 3 passed, 3 total
Snapshots: 0 total
Time: 0.134 s, estimated 1 s
Ran all test suites.
add() has 3 cases/phases
- non overlapping, item array on left of the range array
- push item to result
- overlapping
- update range array in place
- non overlapping, item array on right of the range array
- break the while loop
- push range array to result
- push the rest item array to result
remove() has 2 cases
- non overlapping
- push item to result
- overlapping
- range array overlap whole item array
- skip item
- range array overlap left part item array
- slice & update item array
- push item to result
- range array slice item array into 2 arrays
- slice & update item array
- push 2 item arrays to result
- range array overlap right part item array
- slice & update item array
- push item to result
- range array overlap whole item array