This is true of DARK chocolate, not milk chocolate or white chocolate.
A study I read about some years ago determined that the combination of dark chocolate and caffeine were quite beneficial to brain activity. The best such combinations were dark chocolate with 1)green tea, 2)coffee, or 3)black tea; each with no additives (sugar, cream, etc.)