Quick question about this line of code - Median of a column in R

While I was walking through this tutorial

I stumbled upon this line of code, I am not sure whether I understand how it works properly, but it seems to me that the median is calculated every time the condition is true.

combi$Item_Weight[is.na(combi$Item_Weight)] <- median(combi$Item_Weight, na.rm = TRUE);

Is the median here calculated every time it finds a missing data?