If it weren't for immigrants, New Jersey's economy would most likely be in even worse shape, according to an economist.

LuckyBusiness, ThinkStock

New census numbers suggest people from other countries have helped fill the gap left by people deciding to move out of the state for warmer and more affordable pastures.

Between July 2013 and July 2014, according to the U.S. Census Bureau, more than 56,800 New Jerseyans moved to another state. During the same time period, though, more than 51,000 people planted themselves in New Jersey from other nations.

"New Jersey has always been an immigration destination," said James Hughes, dean of the Edward J. Bloustein School of Planning and Public Policy at Rutgers. "That goes back to the first wave of immigrants from Europe well over 100 years ago."

And without this influx, Hughes said, New Jersey's population would be shrinking at a much quicker pace.

"That would not be good for the economy because we are a consumer-driven economy like the rest of the country," he said. "In addition, you need a constantly-growing labor force…to help service the economy and participate in the economy."

According to the numbers, the counties of Bergen, Hudson and Middlesex experienced the largest population spikes in the given time period. Population declines were registered in Atlantic, Burlington, Camden, Cape May, Hunterdon, Monmouth, Salem and Sussex counties.

The two main reasons people are exiting New Jersey, Hughes said, are cost of living and weather.