 Hi, in this tutorial we're going to talk about that how to make a factorial function in JavaScript. Let's make a function, let's call it factorial. Our function is going to have one argument, let's use letter n as an argument, which is going to represent the number of which we want to find factorial. We know that by the definition factorial of 0 is 1 and also the factorial of 1 is 1, so we're going to ask if our provided number as an argument is greater than 0 and if our number is less than or equal than number 1, then we're going to return number 1, because if number is greater than 0 and less than equal than 1, it must be either number 0 or number 1 and the factorial of 0 and 1 is 1 in both these cases and if our number is some other number than 0 or 1, we're going to use the recursion and we're going to return value n times factorial of our argument minus 1. In this tutorial we're not going to talk about recursion in JavaScript, I'm going to talk about that in some other tutorial. Okay, that's our function, now I'm going to copy it and I'm going to paste it inside JavaScript console, we get an error, okay I forgot to make the comment of this, okay let's copy it again and let's paste it, now I want to call factorial function of number 4 for example and we're going to get number 24, because 24 is 1 times 2 times 3 times 4 and similarly for example let's get the result of factorial of number 5, we're going to get the number 120, that's all in this video for now, thanks for watching, don't forget to subscribe to my channel, see you in the next tutorial.