Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubygems Bundler requireSingle-choice MCQ

What is the practical difference between Kernel#require and Kernel#load for the same file?

# mod.rb sets $c += 1 each time it runs puts require("./mod") # true, runs body puts require("./mod") # false, body skipped load("./mod.rb") # runs body again load("./mod.rb") # runs body again