The HIMYM Episode You Likely Forgot Starred Jennifer Lopez
Daniel Moore
Published Mar 08, 2026
Pop music sensation and actor Jennifer Lopez appeared as Anita in the "How I Met Your Mother" Season 5 episode "Of Course." Anita is the author of a self-help book that aims to empower women to reject self-satisfying men. In an attempt to teach her ex a lesson, Robin asks Anita to break the willpower of the womanizing Barney. As the episode goes on, however, the tables turn, and it's Barney who ends up rejecting the confident Anita.
"Of Course" was well-received upon its release in 2010, with IGN giving the episode a near-perfect score for challenging Barney and expanding Robin's character and emotional circumstances. During a behind-the-scenes interview, Lopez praised the show's writing and called stepping into the role of Anita both easy and fun. "Believe it or not, I don't get to play 'sexy' a lot in my movies. I do romantic comedies and dramas and it's not that type of thing," Lopez said. "I haven't really done that 'femme fatale' role, so it's fun to get to do it here."
One can only hope that Anita returns to guide Hilary Duff's character Sophie in Season 2 of the spin-off "How I Met Your Father."