Here, we see the code. Now this is JSFiddle, as you can see JSFiddle.net. Don't worry about the specific domain, you can get it in iBAQ or it is in the course resources. You can come and take a look at this code, you can play with it. This fork thing lets you create your own copy that you can put on your own account and play with, do whatever you want with but you can freely go and create your own version on this thing and mess around this stuff. Don't worry, it won't break it if already else or anything. Basically, what this system lets us do is put in a bunch of HTML, HyperText Markup Language, which is kind of what renders out like the home and the help and all these sort of visual elements here. This is CSS which is just a way of kind of saying we want this type to look like this, and this background look like this, and then our kind of result is, not kind of, this is indeed the result of whatever we have done over here. Then this is the JavaScript that actually does the various functions. So you can see this word function here. I'm going to kind of zoom in on this a bit. So it make this, the details of this a little bit easier to see. If you go onto this code, this site you probably will, it will probably take you up to the top here and what you can do is just do a find on register_user, that'll get you to this particular chunk of code we're going to look with that here. I'll move this up a bit. Okay. So, here is the real live function register user. This stuff in the parentheses are its inputs. So it's just saying it's going to get a thing email and a password and then this, we'd just call it read password the second time that the user passes in the password, types in their password. This statement here is just a sort of debugging statement for, we used, I used this for a lot of classes and people were kind of playing around with JavaScript. So, this is just sort of for internal purposes. Here, this is exciting I think. Here, we go and we're going to call this function check domain passing it the email. So that's the second function you saw in the diagram before and what's going on is this equality operand in JavaScript just takes the result of this, of calling check domain and getting email so the output of it and it puts it in this variable. So this variable is going to store a true or a false value because that's the output of check domain is. Yes, the domain and this email is okay or no, it is not. What this statement does is it says, "If that is false, so basically, what's going on here is that this exclamation point is it means not. So, if this is not true or false, then do all this basic stuff here, these things that you're seeing, this is code that basically just renders out the error that you saw earlier, error not a valid domain, you got to be from HinH or Alex's website. This causes that to show and then this return thing just means then we're done, we're going to broaden with running register user. This next statement says if the passwords don't match, so password is not equal to this other password, then show that error that you saw earlier, hey, the passwords don't match. Otherwise if everything's okay, then this call Firebase, and do this function create user with email and password, and we're going to pass it the email and the password and then do this other thing. If we have a valid user which is something that comes back is the output of the Firebase call that we make which I did not show in that diagram. So, this is sort of a fourth function that has to do with all this stuff but I didn't want to get into because it's a little bit more complicated. Then go ahead and clear the form where the user typed in all this stuff because we don't want that stuff in there in case somebody else comes to this same browser and registers and then we're done, and then there's another function that triggers on a authentication state change, the details of which you can go in and dive into if you're interested, they are down below but we're not going to worry about that now. So basically, that's what causes that Login button to show. Then if there's an error, what happens is that we're going to get the error code back, these are outputs from Google Firebase. Again, that I've sort of glossed over a little bit. We're going to log that to the console, so developers that are trying to figure out what this code does or what it's doing can see that and then we're going to show these error messages. So, for example, if I went and tried to register a user that already exists, that's something that Firebase is going to, I'm going to externalize the Firebase, it's going to return its output, hey, error 1-2-3-4-5-6, this user already exists on the platform, and then the user or end-user knows that they need to do something else. Okay. So that's that whole register user function, we're going to take a quick look at the helper functions, this is check domain, so it takes an email and then it says, okay, so I want to take the result of get domains or third function down here and I want to put it here in okay domains. These are the domains that we are going to allow. I made a little comment here that obviously if you're really doing this you probably want the user to get an email sent to them that they have to click onto reality that that really is their email address otherwise anybody can kind of say anything and have a valid session that they can get into, and Firebase in fact does that. But we're not going to worry about that here because we're just trying to kind of keep things simple and, basically, what this says, this domain is the domain of the email. So this is a thing that says, basically, take the email that was the input to us and get rid of the user portion of it. So if I pass in bob@gmail.com, this thing which is called a regular expression is going to take the bob@ part and throw that away and then just take whatever's left which should be just the domain and put it into this variable called this domain. Then the kind of punch line of this function here is that we have the statements that says basically without getting into details basically that if you find or this domain in the set of things that are in okay domains, then return true. In other words, if the domain that the user has in their e-mail is in the list of domains that we got back from get domains, return true like yes, this is an okay domain otherwise, return false. Then the code that you saw earlier under register user will deal with handling that false response in it you saw or you can go back and look at. There's an if-else statement there that deals with this possibility and it shows the error that you saw earlier of, hey, this you have to be from HinH or Alex's domain. Then this is our very last function, this one that says get domains, and this one's actually a little kind of silly and trivial is written but I didn't want over-complicate it. So this just says, take this [inaudible] creates a variable domains and put into it this list of domains that are the okay domains and then pass that back as an output. So, that's, this output here is the thing that is getting placed here in okay domains. So when we call the get domains, it doesn't take an input. That's what these, the open and closed parentheses here mean and then the output though gets put into this variable and as we saw it dealt with here. Okay. So, again, if you want to dive into the details and understand them more, go on, get into the JSFiddle, have fun, I hope you enjoy it. If that was enough and you're like okay, then don't worry about it, that's fine. I just wanted you to have a general sense of kind of what does a function sort of generally look like, what do we mean that one function talks to another function, it integrates with it or rather, yes, integrates with it and then in this next set of videos, we're going to look at how do we actually unit test, integration test, and system test this code that we're looking at here?