A for loop is a recursive block that executes code repeatedly until a certain condition is met. The first iteration of a for loop will execute if the condition is true; otherwise, it will continue if it is false. Likewise, a while loop will execute code until the condition is met. If a variable is not present, it will terminate the for loop. You can use a for loop to count up to 10 if you need to.
Functions are blocks of code that perform a single action. A function, for example, calculates the product of two numbers. A function can also take arguments, which are variables. ‘If’ statements are set up to perform certain actions only if a certain condition is met. An ‘if’ statement will execute a block of code if the condition is met. In short, it’s the simplest way to write a web application.