title: How to Retrieve User UID After They Have Been Created Firebase JS
body: <p>I am trying to retrieve the UID of a user I just created in Firebase using JavaScript. Below is my current code:</p>
  <pre><code>firebase.auth().createUserWithEmailAndPassword(email, pass).catch(function(error, data) {
    // Handle Errors here.
    var errorCode = error.code;
    var errorMessage = error.message;
    newusercreateduuid = data.user.uid;
    // ...
    console.log(errorCode + '   Error Message: ' + errorMessage);
  });
  </code></pre>
  <p>I have tried a variety of callbacks including userData, data, user, and many more, but they all return null. I cannot seem to find anything online. I did find another Stack Overflow post using userData, but that returned null for me. How can I retrieve the UID of the user I just created?</p>