New Jersey’s urban centers — especially ones closer to New York City — kept the state growing in the past few years.

Hudson, Bergen and Middlesex had the most people move into their towns, according to Census data. These counties have seen an exponential increase in residential construction that could accommodate the shift back toward the state’s urban core. Harrison in Hudson County issued over 1,000 permits for new home construction in 2017. From 2009 to 2011 — at the height of the housing crisis — the same town issued only 26 permits.

In a stark contrast, Camden, Sussex and Atlantic counties lost the most people. The shrinking counties, immensely popular in the 1980s and 1990s, had one thing in common — they all existed far away from New York City and surrounding areas. This is a reversal of how these regions grew from 1950 to 2000, when suburban areas experienced massive growth and urban counties languished.

To make matters worse, Shore towns are still struggling to bounce back from the effects of Hurricane Sandy. Ocean County has seen some increase, but mostly due to the Lakewood boom. Population in towns without a lot of inland space have either declined or remained at the same count. Atlantic City’s casino closings and decreased revenue have not been attractive for property owners, either.

These shifts are often symptomatic of lifestyle changes brought about by American millennials, who dominate the workforce today. Younger folks are popularizing urbanized communities that have walkable town centers and access to mass transit, pushing away from suburbia, Census data shows. They’re also more open to urban apartment living, and pushing off marriage and children for longer than the generation before them.

Overall, the state’s population grew by 186,943, from 8,721,577 in 2010 to 8,908,520 in 2018.

These 10 towns gained the most people:

10. Wood-Ridge, Bergen County

Population 2010: 7,572

Population 2018: 8,511

Percent change: 12.40%

9. Edgewater, Bergen County

Population 2010: 10,766

Population 2018: 12,184

Percent change: 13.17%

8. Weehawken, Hudson County

Population 2010: 12,605

Population 2018: 14,327

Percent change: 13.66%

7. Raritan, Somerset County

Population 2010: 6,814

Population 2018: 7,797

Percent change: 14.43%

6. Lakewood, Ocean County

Population 2010: 87,681

Population 2018: 100,763

Percent change: 14.92%

5. East Greenwich, Gloucester County

Population 2010: 8,909

Population 2018: 10,396

Percent change: 16.69%

4. Monroe, Middlesex County

Population 2010: 37,171

Population 2018: 43,828

Percent change: 17.91%

3. Harrison, Hudson County

Population 2010: 13,569

Population 2018: 16,180

Percent change: 19.24%

2. Secaucus, Hudson County

Population 2010: 16,008

Population 2018: 19,390

Percent change: 21.13%

1. Woolwich, Gloucester County

Population 2010: 8,985

Population 2018: 12,381

Percent change: 37.80%

These towns lost the most people:

10. Lebanon Township, Hunterdon County

Population 2010: 6,514

Population 2018: 6,132

Percent change: -5.86%

9. Hopatcong, Sussex County

Population 2010: 15,440

Population 2018: 14,362

Percent change: -6.98%

8. Union, Hunterdon County

Population 2010: 6,031

Population 2018: 5,599

Percent change: -7.16%

7. Vernon, Sussex County

Population 2010: 24,376

Population 2018: 22,369

Percent change: -8.23%

6. Ventnor City, Atlantic County

Population 2010: 11,151

Population 2018: 10,232

Percent change: -8.24%

5. New Hanover, Burlington County

Population 2010: 8,062

Population 2018: 7,366

Percent change: -8.63%

4. Ocean City, Cape May County

Population 2010: 12,289

Population 2018: 11,202

Percent change: -8.85%

3. Margate, Atlantic County

Population 2010: 6,763

Population 2018: 6,076

Percent change: -10.16%

2. Brigantine, Atlantic County

Population 2010: 10,115

Population 2018: 8,966

Percent change: -11.36%

1. Union Beach, Monmouth County

Population 2010: 6,324

Population 2018: 5,549

Percent change: -12.25%

About the data: The data comes from population totals from the U.S. Census Bureau American Community Survey. Towns with population less than 5,000 were eliminated from the analysis as they tend to have a higher margin of error and can skew the results. We removed Princeton from our list since the current-day town used to be two towns in 2010.

Disha Raychaudhuri may be reached at disha@njadvancemedia.com. Follow her on Twitter @Disha_RC.