Did you google?
for loop is similar in java and javascript.