Javascript loop examples