in Technology by

What does the following code denote about index updation?

for (index in 1:3) {
index <- index * 2

Please log in or register to answer this question.

1 Answer

0 votes

In a for-loop the index is updated at the beginning of each iteration. Therefore, reassigning the index symbol during one iteration doesn’t affect the following iterations.

Related questions