Correct. At least at the federal level.
The Age Discrimination in Employment Act (ADEA) only forbids age discrimination against people who are age 40 or older. It does not protect workers under the age of 40, although some states do have laws that protect younger workers from age discrimination.
If your state or local jurisdiction doesn't protect young(er) workers against discrimination and only the federal law applies, then an employer can discriminate against the young but not the old.