While a lot of people used the term "retail apocalypse," 2017 was really a year better described as a "retail shakeout." There were a number of companies that failed last year, and many more that remain on the brink, but Best Buy (NYSE:BBY), Wal-Mart (NYSE:WMT), and Costco (NASDAQ:COST) all showed they were here to stay.

It was a strong year for all three of these retailers, each of which emphatically answered questions about its long-term success prospects. The formula was different for each chain, but the results showed that the move toward digital that has wiped out so many retailers won't be taking down Best Buy, Wal-Mart, or Costco.

The exterior of a Best Buy

Best Buy declared its turnaround a success in 2017. Image source: Best Buy.

What did Best Buy do?

For the past few years, Best Buy had been executing a turnaround plan called "Renew Blue." In March, the company's CEO, Hubert Joly, declared the turnaround phase over and said that the company had entered a growth phase.

"In my turnaround manual, which I have, you don't start with strategy," Joly told the Star Tribune. "You start with improving what you have. Then you work on strategy later, and that's where we are. Now we're focused on growth and trying to define what we want to look like when we grow up."

Investors have clearly liked what Best Buy has accomplished. After finishing 2016 at $42.67, shares closed 2017 at $68.47, a 60% gain, according to data provided by S&P Global Market Intelligence

What did Wal-Mart do?

Call 2017 the year Wal-Mart showed it would be able to compete with Amazon. The brick-and-mortar retail giant made huge strides toward becoming a true ominchannel retailer. Led by digital boss Marc Lore, the company got rid of its membership-based delivery service and offered free two-day delivery on eligible online orders.

In addition, the company stepped up its employee training efforts, raised wages, and tried out a whole lot of new ideas. Some, like curbside pickup and in-store kiosks for picking up online orders, appear to have worked. For others, the jury is still out, but this was a year when the giant retailer showed it could think like a start-up -- something its big, digital rival has always been able to do well.

The market clearly rewarded Wal-Mart for its transformation. After its shares closed 2016 at $69.12, they finished out 2017 at $98.75, a nearly 43% gain, according to data provided by S&P Global Market Intelligence. 

What did Costco do?

Of the three retailers on this list, Costco may have faced the most questions entering the year. The warehouse club has been very resilient as the internet has grown, but it has also been stubborn in clinging to its business model.

In 2017, though, Costco made changes. It continued to evolve its website and saw steady gains, including a 43.5% spike in its fiscal Q1 2018. Perhaps most importantly the retailer found an answer for rivals offering quick delivery. It entered a partnership with Instacart at many of its locations that offers one- or two-hour delivery.

In addition to these big changes, the company kept up its normal around-90% membership retention rate, despite raising its membership costs in the United States. It also kept adding stores at its normal slow, steady pace, adding 23 since Q1 2016.

Costco shares actually had some big dips in 2017, but in the end, the numbers were strong. Shares in the company closed 2016 at $160.11 before rising to $186.12 to finish 2017, a 16% gain, according to data provided by S&P Global Market Intelligence. 

Why these three?

Best Buy, Wal-Mart, and Costco all offer very distinct reasons for consumers to visit their stores. In doing that, though, none of the three ignored the fact that some customers increasingly want to be able to shop at home. All three moved toward omnichannel shopping without sacrificing what makes their stores destinations for consumers.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.