How can you repeatedly execute a code in java script?

1) use for loop

2) do while loop