One of 2021's clear investment winners has been Costco (COST 0.59%) stock, which has risen 23% year to date -- beating the S&P 500's 18% gain over this same time frame.

With such strong performance, expectations for the company were high going into Costco's fiscal fourth-quarter earnings release this week. But the company delivered. Revenue and earnings per share for the quarter both easily beat analyst expectations, driven by strong double-digit growth in same-store sales.

Here's a closer look at Costco's fiscal fourth-quarter business performance.

A shopping cart in the aisle of a wholesaler's store.

Image source: Getty Images.

Strong financial performance

The wholesale retailer's revenue rose 17.5% year over year to $62.7 billion in fiscal Q4. Earnings per share was $3.76, rising from $3.13 in the year-ago period. Analysts, on average, were expecting revenue and earnings per share of $61.4 billion and $3.58, respectively.

Helping drive this robust performance was a 15.5% increase in same-store sales.

One metric from the quarter worth drawing special attention to is Costco's 11.2% year-over-year growth in comparable e-commerce sales. This strong growth rate is particularly impressive when investors consider that it was on top of 90.6% growth in comparable e-commerce sales in the year-ago quarter, as many consumers ramped up their online ordering amid lockdowns.

Management also noted that its e-commerce app now has more than 10 million downloads. "It's continually improving, with additional features coming soon," said Costco chief operating officer Richard Galanti in the company's earnings call.

Specifically, management said it will transition its digital payments for its Costco credit card from a pilot program to a full rollout by the middle of October. In addition, members will soon be able to view their receipts from warehouse purchases online.

Costco's advantage in dealing with supply-chain shortages

Management said that supply-chain shortages and inflation challenges persisted during the quarter. As Galanti explained:

From a supply chain perspective, the factors pressuring supply chains and inflation include port delays, container shortages, COVID disruptions, shortages on various components, raw materials and ingredients, labor cost pressures and [trucks] and driver shortages. Chip shortages continued as well, impacting the supply of computers, tablets, video games, and major appliances. Compounding these problems, there has also been outsize demand for some items because of the Delta COVID variant, leading management to begin rationing sales of some items, such as toilet paper, paper towels, Kirkland Signature water, and various cleaning items.

But Galanti said Costco is in an advantageous position over some of its competitors, thanks to its financial strength, which allows the company to order items early.

Based on Costco's strong same-store sales growth, continued strength in e-commerce, and its better-than-expected earnings in an inflationary environment, management is handling its operating challenges extremely well. The company's ability to navigate this environment expertly shows why investors are willing to pay a premium for this stock.