Creating AngularJS custom Filter that actually filter

I know that in angularJS there is some built in filter: for example <li ng-repeat="student in students | orderBy:'name'">

But I don’t want to use it, I want to build a custom filter like above one.

and I tried below one but I am not getting how to do it.

Do you have any example like this one?

var app = angular.module("app", []);


app.filter('filterByName', function () {
  return function (item) {
      // do something there
  };
});

Anyone know how to do it or any example like this?

Source: AngularJS