title: How can I convert an unnamed function to a named one?
body: <p>I made the function below. Basically, if a player types /port and the name of another player the function returns true, I believe.</p>
  <pre><code>    mp.players.forEach(_player =&gt; {
          if(_player.name === name)
              return true;
      });
  </code></pre>
  <p>I want to name the function above so I can do something like:</p>
  <pre><code>if (functionName) [code]
  </code></pre>
  <p>So, how can I name  the function above? Or is there any other way to check if it's true. I'm trying to list it on the try...catch statement below:</p>
  <pre><code>try {
          if (player.adminLevel &lt; 8)  throw &quot;Error 1&quot;;
          if (!targetPlayer) throw &quot;Error 2&quot;;
          if (player.adminLevel &lt;= targetAdminLevel) throw &quot;Error 3&quot;;
          //AND THE NEW ONE HERE
          if (functionName) throw &quot;Error 4&quot;;
      }
  </code></pre>