A function is said to be recursive if it calls itself from within its own code block. Although recursion can be a powerful tool, caution must be exercised with its use. Like a loop, a recursive function must always move to satisfy an ending condition. Finally, recursive function calls require great amounts of system resources and memory, so should be used sparingly.
I/O functions
The JavaScript language includes several methods to facilitate program I/O:
Top-down approach to programming
Solving complex problems can be facilitated by using the top-down method of preparation. The first step is to write the objective on a piece of paper. The next step is to break the task down into two or more component tasks. Each task should be further simplified until it cannot be broken down any further. Finally, each individual task should be implemented in code and then rigorously tested. Finally, the complex problem can be solved by piecing together the individual pieces.