Hexlet's blog

New Post
Development

It is very easy to make mistakes when you have to handle variables, change them, keep track, etc. Especially in a loop. A great way to understand what's going on is to use the simplest debugging technique — console.log. This function prints onto the screen whatever you pass to it.

I have a function that iteratively calculates the factorial. The idea is simple: multiply numbers from 1 up to n.

User avatar R. D.
R. D.
19 January 2017
We teach programming in a new way. Check out "Intro to Programming" course.

Hexlet

Learn about why Hexlet is so good →