Intermediate
Ruby
Q60 / 100
What is the difference between "load" and "require" for including external Ruby files?
Correct! Well done.
Incorrect.
The correct answer is B) require loads a file only once (tracking loaded files), while load executes the file every time it is called, even if previously loaded
B
Correct Answer
require loads a file only once (tracking loaded files), while load executes the file every time it is called, even if previously loaded
Explanation
require keeps track of files already loaded and skips re-loading them, while load re-executes the file content each time it is called.
Progress
60/100