Basic Algorithm Scripting: Factorialize a Number - Sugestion

<%= @topic_view.topic.title %>
<%= @topic_view.topic.average_rating %> <%= @topic_view.topic.posts.count { |p| !!p.custom_fields['rating'] } %>


I just finished this lesson and then proceeded to check the hint page as usual (It doesn’t hurt to check alternative solutions).

I’ve been under the impression that this lesson had the objective of introducing recursion. However, recursion is not mentioned anywhere outside the hints page.

I ended solving with the code below:

function factorialize(num) {
let x = 1;
for (let i = num; i > 1; i--) {
x *= i;
num = x;
return num;


There is no recursion here is no recurs…

I’d see a recursion example (or at least a mention) in the lesson’s introductory text as a relevant improvement.