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: 
Maybe you're looking for this:

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

```
[Tân's version](https://stackoverflow.com/a/59893737/6320039) is a correct answer to your question. However, with recent JavaScript you can simplify even more thanks to [`array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes):

```js
$scope.vergleich = () =>
    $scope.relrechtsform.includes(dataService.dic.alt.rechtsformKanlei || dataService.dic.neu.rechtsformKanlei)

```