Heading to the grocery store for your weekly food run is never a good idea when you’re hungry (or after smoking weed). Sure enough, a bunch of processed crap will inevitably end up in your basket while your belly rumbles and your brain searches for fuel.
But why that phenomenon happens was not well-understood by food scientists, until a new study from Johns Hopkins University tackled the topic. As it turns out, you don’t even have to be in the grocery store for the effect to take hold.
Photos of junk food like candy, ice cream, and pizza can distract you when hungry, even if you’re working intently on another task, according to the study, which was published in the journal Psychonomic Bulletin and Review. Also interesting: After you taste the junk food, your cravings re-orient closer to healthy food territory, the investigation also found.
For the study, scientists put people through difficult computer tests while images—high-fat/high-calorie foods, healthy foods, or just everyday objects—flashed quickly on the side of the screen. Researchers found that the pictures of the junk food made the participants almost twice as distracted from completing their tasks, compared to healthy food or common objects. In a follow-up experiment, a new batch of people gnawed on two small candy bars before the test. Surprise: Junk food wasn’t quite as distracting.
“What your grandmother might have told you about not going to the grocery store hungry seems to be true,” said lead study author Corbin A. Cunningham, Ph.D., distinguished science of learning fellow in the department of psychological and brain sciences. “You would probably make choices that you shouldn’t or ordinarily wouldn’t.”
In the meantime, here’s a guide to the best (and worst) Halloween candies—because if you’re gonna snack on sugary crap, you might as well try to do it right.