"I don't know about you but when I was a little girl... you know how you have your favourite song that you just play over and over again?" Swift asked the crowd before introducing Lopez.
"You just blast it in your room and sing in front of your mirror into a hairbrush. You had that one favourite song that was your favourite to dance to. Los Angeles, this is my hairbrush song," she added.
Lopez then appeared on stage to huge cheers from the audience before singing the 2002 hit. Swift duetted with Ellie Goulding and Cher Lloyd during her other shows at the Staples Centre last week.
J. Jayalalithaa passes away: Her life in pictures
Photos: Shah Rukh Khan, Deepika Padukone, Alia Bhatt at an awards show
Photos: Big B, Iulia Vantur at Himesh Reshammiya's album launch
Photos: Aamir Khan with 'Dangal' actresses at fashion show
Spotted: Twinkle Khanna, Shriya Saran at an event in Mumbai