Question: Which one should i use in an angular app and why?

```
array.filter(o => o.name === myName);

```

or 

```
$filter('filter')(array, {name: myName}, true);

```

Answer: 
While using $filter('filter') can be easier and more syntactically attractive, I can think of four good reasons to use Array.filter over $filter('filter')

**Efficiency**

While it is true that $filter('filter') uses Array.filter under the hood, it also uses other code, including deep comparisons, in addition to Array.filter. In most cases the speed difference is negligible, but in some use cases it can be substantial. When working with large data objects for example, I've found that using Array.filter makes a difference.

**Angular 2+ does not support AngularJS-style filter**

From the [angular migration guide](https://angular.io/guide/upgrade#no-angular-filter-or-orderby-filters):

> 
> The built-in AngularJS filter and orderBy filters do not exist in
>  Angular, so you need to do the filtering and sorting yourself.
> 
> 
> 

If there is any possibility that you may upgrade to Angular 2 or higher in the future, then using Array.filter will save you some migration migraines. Even if you don't plan on upgrading, clearly the Angular team didn't think the AngularJS filter was worth keeping, which leads me to think it's probably better to avoid it anyway.

**Favor native code over library code**

Libraries and frameworks like AngularJS are amazing tools; But if you have to choose between using vanilla javascript or using a library, *and there isn't a good reason to use the library*, you should always use the vanilla javascript. It is more universally understood, less dependent on 3rd party code, etc. There are a plethora of online articles arguing this point.

**"$filter" inhibits type-checking in Typescript files**

This one only applies if you use (or plan to use) Typescript. At the time of writing, the @types library for angularjs defines the return type of all $filter functions as *any*, which can lead to some serious type-checking problems if you aren't careful. By contrast, Array.filter always returns the expected array type.
You should use `Array.filter` and then assign the result. When you use `$filter`, it is re-applied at the end of every **$digest** cycle for all the bindings and that is performance intensive to watch for the values and update the results after every **$digest** cycle. Instead you should filter your result and assign it to your scope variable explicitly