title: What is javascript/typescript equivalent of this python function?
body: <p>I couldn't convert this syntax to js or ts:</p>
  <pre class="lang-py prettyprint-override"><code>    def get_index(self):
          path = self.get_request_path()
          if &quot;/_async_search&quot; in path and &quot;/_search&quot;:
              # no index we wildcard
              return next((sub_part for sub_part in path.split(&quot;/&quot;) if sub_part != &quot;&quot;), &quot;*&quot;)
          return None
  </code></pre>