Hi everybody!

This is my first post here, so let me briefly introduce myself.

My name is Bruno, I’m from Verona, Italy, and I’ve recently (well, it was June 2017) started studying and loving programming. After completing some basic courses about Web Dev on different platforms, I’ve decided to put all I’ve learned into practice. At the moment I’m studying JavaScript and facing a few problem sets (functions, arrays). Straight to the point now: I’d like to make some functions more user interactive, i mean, I want to grant the user the chance to input a value and return something.

For example, this function returns “true” if a number is even, and “false” if a number is odd:

```
function isEven(num) {
if (num % 2 === 0) {
return true;
} else {
return false;
}
}
isEven(4);
```

I changed it a little bit in order to make it user interactive:

```
var check = prompt(Number.num);
function isEven(num) {
if (num % 2 === 0) {
return true;
} else {
return false;
}
}
isEven(check);
```

Now, if I want to add the same feature for a more complex function which, say, return the factorial of a number, how can I proceed? I tried different approaches but I can’t wrap my head around it. This is the basic function:

```
function factorial(num) {
var result = 1;
for (var i = 2; i <= num; i++) {
result *= i;
}
return result;
}
factorial(4);
```

Thank you for the help