JavaScript for loop provides you the functionality to execute the same code block for specified number of times. For loop enables you to reduce the code length instead of writing same code number of times to display the desired output. Try the sample below to learn and practice the JavaScript For loop code: