In English it is common to take verbs and use them as nouns, to take nouns and use them as verbs, to use adjectives as either nouns or verbs, and vice versa.
In particular, phrases such as "two-year-old", "five-year-old", and "twelve-year-old" can be used either as adjectives ("twelve-year-old scotch") or as nouns ("you should see how my twelve-year-old has taken to music" or "She is the best two-year-old to enter the Derby in years.") The example sentence is simply a case where the writer has chosen to use a noun form rather than an adjective form.
Because using the noun form permits omitting a word ("baby", "child" or "horse"), it may be favored with the modern pressure for brevity.
> a person or animal that is two years old.
> (of a person, animal or thing) that is two years old.
See also Difference between "two years old and two-year-old"