title: Return Key Val Pair from Arrow function
body: <p>I'm trying to return a key val pair from a <code>filter</code> based on the presence of <code>__</code></p>
  <p>Got this:</p>
  <pre><code>function trigger() {
    const ss = SpreadsheetApp.getActiveSpreadsheet();
    const ranges = ss.getNamedRanges();
    const rangeNames = ranges.map(range =&gt; range.getName());
  
    let triggers = {};
    triggers = rangeNames.filter(name =&gt; {
                                 if (name.indexOf(&quot;__&quot;)&gt;-1) {const val = ss.getRangeByName(name).getValue(); 
                                                            
                                                             triggers.name = val
                                                             return triggers;
                                                            }
  });
  
  console.log(triggers);
  
  }
  </code></pre>
  <p>But it just seems to return <code>name</code>. Any help would be gratefully received</p>