You've probably used at least one of those Scratch control blocks to make something happen a certain number of times, or until (usually) something is touching something else.
Or you may have used the glide block, which has its own built-in looping.
Javascript has the same idea, just expressed in words instead of blocks.