I am having trouble understanding the result of this code:

```
function diffArray(arr1, arr2) {
var newArr = [];
var ordArr = arr1.concat(arr2).sort(); //[1,1,2,2,3,3,4,5,5]
for(var i=0; i<ordArr.length; i++) {
if(ordArr[i] !== ordArr[i+1] && ordArr[i] !== ordArr[i-1]){
newArr.push(ordArr[i]);
}
}
console.log(newArr);
}
diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
```

The result is **[4]** . But how I understand it, I always come up with **[1,2,3,4,5]** as the answer.

Here is how I interpret the **if statement**.

- if ordArr is not equal to the value of ordArr[i+1] and ordArr[i] is not equal to the value

of ordArr[i-1] then push the current value of the current ordArr to the newArr.

So.

```
ordArr[i] !== ordArr[i+1]
result is [1,2,3,4,5]
```

and

```
ordArr[i] !== ordArr[i-1]
result is [1,2,3,4,5]
```

then newArr should be

```
[1,2,3,4,5]
```

But why is the result only [4] . How does **&&** affect the result?