In 2014, Zoe Saldana, 38, who plays the female lead in the film Guardians of the Galaxy, told the Telegraph newspaper: "By the time you are 28, you're expired, you're playing mummy roles."

IMDB says the law, known as AB 1687, was unfairly tailored to apply only to it.

Its legal action says: "IMDB shares the worthy goal of preventing age discrimination, but AB 1687 is an unconstitutional law that does not advance, much less achieve that goal."

A representative of the California Attorney General's office said: "While age information on Hollywood's biggest stars is available from other online sources, this bill is aimed at protecting lesser-known actors competing for smaller roles."