Question: ```
$scope.vergleich = function () {
    if ($scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei || dataService.dic.neu.rechtsformKanlei ) !== -1) {
        return true
    } else {
        return false;                   }
    }
}

```

I am currently student and intelliJ tells me I have to simplify this if-statement but I have no idea how. Maybe somebody can help me.

Answer: 
The simplification is probably that, if `condition` is a boolean, :

```
if (condition) { 
  return true;
} 
else { 
  return false;
}

```

is equivalent to 

```
return condition;

```

**However** there also seems to be a logical error in your test.

```
$scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei ||
                        dataService.dic.neu.rechtsformKanlei ) !== -1

```

Does **not** mean the same thing as :

```
$scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei) !== -1 || 
$scope.relrechtsform.indexOf(dataService.dic.neu.rechtsformKanlei) !== -1

```
You can just use your condition instead of using `IF else` statement -: 

```
$scope.vergleich = function () {
    return ($scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei ||
                        dataService.dic.neu.rechtsformKanlei ) !== -1);
};

```