Hey, I’m looking for some input on my code for this challenge in Basic Algorithms - Factorialize a Number, I passed the test, but my code seems to be very different then most others; using the while format. Am I doing this in a weird way? Thanks in advance for the comments!
function factorialize(num) {
var x = 1;
var y = 1;
while (x <= num) {
y = y * x;
x++;
}
return y;
}
factorialize(5);