title: Angular Router Events: NavigationEnd -- How to filter only the last event
body: <p>I want to extract <strong>only the last event entry of type NavigationEnd</strong> from router.events. But somehow I can't find a proper way to do this. Whatever I try the following code snipped is the only way to get access to these objects of interest. </p>
  
  <pre><code>let ne: any;
  
  router.events.filter(e =&gt; e instanceof NavigationEnd)
     .forEach(e =&gt; {
        ne = e as NavigationEnd;                 
     });
  
  console.log('target page: ', ne.urlAfterRedirects);
  </code></pre>
  
  <p>But do I really have to use .forEach() letting it run though all entries and using then the last entry? Isn't there a better way to handle the events as a kind of array and then say </p>
  
  <pre><code>ne = arrayOfEvents[arrayOfEvents.length-1]
  </code></pre>
  
  <p>?</p>
  
  <p>I'm getting crazy about it but it seems that I can't see the wood for the trees...</p>