Total Complexity | 4 |
Complexity/F | 1.33 |
Lines of Code | 14 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | module.exports = function diff(currentArray, otherArray, total) { |
||
2 | const differenceArray = currentArray.filter( |
||
3 | (value) => otherArray.indexOf(value) < 0 |
||
4 | ); |
||
5 | let differenceArrayB = []; |
||
6 | |||
7 | if (total) { |
||
8 | differenceArrayB = otherArray.filter( |
||
9 | (value) => currentArray.indexOf(value) < 0 |
||
10 | ); |
||
11 | } |
||
12 | |||
13 | return differenceArray.concat(differenceArrayB); |
||
14 | }; |
||
15 |