Organizing Your JavaScript Code with Functions
Published in
9 min readOct 14, 2019
Functions are small blocks of code that takes in some inputs and may return some output or have side effects, which means that if modifies some variables outside the function. We need functions to organize code into small blocks that are reusable. Without functions, if we want to re-run a piece of code, we have to copy it in different places. Functions are critical to any JavaScript program.