Javascript/TypeScript: How to run code directly after the return statement in the same scope?

Viewed 1214

First of all: Is it possible? I have a vague memory about this being possible but I cannot seem to formulate my question well enough for google / stack to give me an idea of what to do.

Given this code (transform function within a custom pipe -Angular 2-):

transform(statuses: Status[], test: string): Status[] {

    return statuses.filter(status => status.Id === 1);

    //Code to be executed after return has happened
    this.updatePager.emit();
  }   

How do I get the code this.updatePager.emit();to happen right after my return statement.

Kind regards everyone. Tips on how to formulate this question so I can search further are always welcome!

4 Answers
Related