Her campaign slogan: “It’s time for one of us.”

That appeal to the tribal identities of class, age, gender and ethnicity turned out to be a good gamble, steering her to the nomination in a year when Democratic voters are increasingly embracing diversity as a way to realize the change they seek in the country.

Given an option, Democratic voters have been picking women, racial minorities, and gay men and lesbians in races around the country at historic rates, often at the expense of the white male candidates who in past years typified the party’s offerings. ­Ocasio-Cortez’s opponent, veteran Rep. Joseph Crowley, a white man representing a ­majority-minority district, fit that bill.