title: How do I pass a variable to a callback in puppeteer's $eval?
body: <p>The following code doesn't work due to a <em>ReferenceError</em> when trying to access <code>uid</code>. I understand that the <code>eval</code> code is running inside the browser's context and thus doesn't have access to this variable, but I don't know how to pass the variable's value regardless:</p>
  
  <pre><code>var uid = 'foo@example.com';
  await page.$eval('#uid', el =&gt; el.value = uid);
  </code></pre>