(CNN) Within weeks of the Grand Princess cruise ship arriving off the California coast -- an early harbinger of the coming coronavirus pandemic -- Gov. Gavin Newsom issued the first statewide mandatory restrictions in the United States.

He ordered California's nearly 40 million residents to stay home to help combat the outbreak, but he didn't stop there.

While many states scramble for desperately needed equipment and supplies, Newsom this week announced a deal for millions of masks for health care workers, and though the state is still battling the outbreak, it finds itself in a position to donate hundreds of ventilators to hospitals across the country.

California and New York -- the nation's hardest-hit state -- had about the same number of coronavirus cases in the first week of March, according to Covid Tracking Project

New York City reports more than 800 Covid-19 deaths in 1 day

New York City reports more than 800 Covid-19 deaths in 1 day 02:52

New York City reports more than 800 Covid-19 deaths in 1 day

By Wednesday morning, California had more than 17,000 cases compared to nearly eight times that in New York, or more than 140,000 cases. The Golden State has 452 deaths to New York's more than 5,000.

"When we write this history and look at the tens of thousands of lives in California that will have been spared, I think there will be lots of factors that went into it," said Dr. Robert Wachter, professor and chair of the department of medicine at the University of California, San Francisco.

"The most important was that leaders of all types -- whether they were in government or in businesses -- took it seriously, believed that this was a real risk and did the right thing early."

Here is what California did right in response to the contagion:

Equipment secured

After announcing two weeks ago that the state had distributed 24.5 million N95 masks, Newsom on Tuesday night told "The Rachel Maddow Show" on MSNBC that California had struck a deal for more than 200 million protective masks per month.

About three-quarters will be N95s, the rest surgical, he told the show.

Saying "enough is enough" when it comes to states competing for vital equipment, he said, "We're confident we can supply the needs of the state of California and potentially the needs of other Western states."

Contracts inked in recent days -- including with a consortium of nonprofits and a California manufacturer -- "give me confidence in being able to say that," the governor said.

JUST WATCHED Gov: Illinois needs thousands of ventilators in 2 weeks Replay More Videos ... MUST WATCH Gov: Illinois needs thousands of ventilators in 2 weeks 08:01

California has also done well not only refurbishing ventilators but procuring new ones -- most notably 1,225 from Tesla billionaire Elon Musk, who had promised only 1,000 of the devices. Bloom Energy also said last month it was repurposing a manufacturing plant to supply ventilators.

The state's so ahead of the game on ventilators that it began sending 500 of its ventilators to hot spots in Illinois, New Jersey and New York on Tuesday. Based on the advice of federal emergency officials, ventilators will also be loaned to Washington D.C., Delaware, Maryland and likely Nevada, Newsom said.

Though California is still fighting its own Covid-19 battle, and things can change, "we're confident that the number of ventilators that we currently have in possession are adequate to the task in the very short term," the governor said, applauding residents for doing their part in slowing the virus' spread.

New Jersey Gov. Phil Murphy tweeted his appreciation Tuesday, saying his state is "beyond grateful" to Newsom, and "we will repay the favor when California needs it."

Los Angelenos can apply for testing

All 10 million residents in Los Angeles County are now eligible to apply for a coronavirus test

JUST WATCHED Fact check: Trump misleads on coronavirus testing Replay More Videos ... MUST WATCH Fact check: Trump misleads on coronavirus testing 01:52

There are "no longer any limits" on who can apply to be tested, Los Angeles Mayor Eric Garcetti said Monday, explaining that the county is scrapping prerequisites such as being older than 65, underlying medical conditions and weakened immune systems.

It doesn't mean officials have a test for everyone in the county -- the most populous in the US -- but the testing capacity is now greater than the number of cases they've been receiving under the previous guidelines.

Face coverings mandated in Los Angeles

Employees and customers of essential Los Angeles businesses remaining open during the stay-home order must wear face coverings, Garcetti said Tuesday.

Businesses can refuse service to customers who do not wear a face covering starting Friday morning, according to Garcetti's order, which he said was designed "to take care of those who are taking care of us."

JUST WATCHED Mukherjee: 'People should be wearing masks' Replay More Videos ... MUST WATCH Mukherjee: 'People should be wearing masks' 12:18

The rule goes for grocery stores, pharmacies, restaurants, hotels, taxis, ride-share companies and construction firms, all of which were ordered to provide face coverings for workers.

Businesses are also required to provide access to a clean restroom with soap and sanitizer, and to allow employees to wash their hands every 30 minutes.

Easter park shutdown

Los Angeles will also close its parks for Easter. Families traditionally use the facilities for Easter egg hunts and other gatherings, Garcetti said, but it's too risky this year.

"This is such a great tradition that many families have, but we can't afford to have one cluster of just even a few people together. It could spread this disease to more people and kill them," he said.

The parks will be closed Saturday evening and reopen Monday morning, the mayor said.

Park rangers and the Los Angeles Police Department will be patrol the park to enforce the closures.

Silicon Valley employees started working from home

In early March, health officials in Northern California recommended that companies allow employees to work from home, suspend nonessential travel and stagger starting and closing times.

JUST WATCHED New to working from home? Here's what you should know Replay More Videos ... MUST WATCH New to working from home? Here's what you should know 02:02

"So much of the businesses, particularly in Northern California, are the tech businesses, and companies like Google and Apple and Salesforce and others told their employees to work from home as early as March 5," said Wachter.

"There was a general sense here that this is serious stuff, that the experts are telling us we need to do this -- and people listened."

San Francisco Bay area issues shelter-in-place order

Along with San Francisco and Berkeley, residents in San Mateo, Santa Clara, Marin, Alameda and Contra Costa counties were required to stay home, per orders from local health officers.

Essential businesses stayed open, as did mass transit -- but only for travel to and from essential services.

"That was no accident," Dr. George Rutherford, professor of epidemiology at the University of California San Francisco, said of the timing. "It was the day before St. Patrick's Day, which is a huge mixing event as you can imagine."

JUST WATCHED Streets empty as San Franciso is ordered to shelter in place Replay More Videos ... MUST WATCH Streets empty as San Franciso is ordered to shelter in place 02:27

San Francisco also lent assistance to those hurt by the restrictions, including grants for small businesses.

In Santa Clara, it appears the early action yielded big dividends, as the time span in which cases have been doubling dropped from three days to two weeks, or maybe longer, county public health officer Dr. Sara Cody said Wednesday.

"When you act early, just as the curve is taking off, you can slow things down. That's what we did," she said. "Early action is also extraordinarily disruptive, both socially and economically. ... If you wait and take action later, you get the same social and economic disruption -- you get all those harms -- but you don't get as much benefit."

Governor issues early statewide stay-at-home order

On March 19, Californians were ordered not leave home except for essential needs.

"This is a moment where we need some straight talk," Newsom told reporters at the time. "As individuals and as a community, we need to do more to meet this moment."

On the list of entities allowed to stay open were groceries, pharmacies, gas stations, farmers markets, food banks, convenience stores, delivery restaurants, banks, some local government offices and law enforcement agencies.

JUST WATCHED How recovered California Covid-19 patient is trying to save lives Replay More Videos ... MUST WATCH How recovered California Covid-19 patient is trying to save lives 01:53

California also benefited from strong and early public health awareness campaigns and a sprawling demography compared to more densely populated places such as New York City, said Dr. Robert David Siegel, a microbiology and immunology professor at Stanford University.

California's efforts have been bold and controversial but appear to be working, Wachter said last week.

"There were people that said, 'Why are you doing this? You're going to kill the economy,'" he said. "I think there's just a general attitude -- let's trust the science. If this is what the science tells us, we need to take it very seriously."