Walmart this morning posted strong holiday sales growth for its holiday quarter, with U.S. sales up 4.2 percent over the same time last year, and a 43 percent rise in Walmart’s U.S. e-commerce sales. The retailer topped analyst expectations, with $138.8 billion in revenue for the quarter, just ahead of the forecasted $138.76 billion; and earnings per share of $1.41, ahead of analysts’ estimates of $1.33.

Most notably, Walmart attributed the strong e-commerce growth to the expansion of its grocery pickup and delivery businesses, and a broader assortment on Walmart.com.

The company has been challenging Amazon, Instacart, Target’s Shipt and others on grocery. It had toyed with the idea for years, before figuring out a model that made sense and didn’t lose money. With grocery pickup, Walmart offers an alternative to the higher cost of using grocery delivery services, while still allowing for convenience, as its customers can skip shopping the aisles and instead remain in their cars while groceries are loaded into the trunk.

More recently, the company began working with a network of partners to offer grocery delivery to customers’ homes. It has ended relationships with Uber, Lyft and Deliv while adding new partners like Point Pickup, Skipcart, AxleHire and Roadie, and shifting business to partners like Postmates and DoorDash.

Today, Walmart’s grocery pickup service is available at more than 2,100 Walmart locations and delivery is offered at nearly 800. It expects to offer pickup at 3,100 locations and delivery at 1,600 locations by the end of fiscal year 2020, it says.

Meanwhile, Walmart has been working to expand its assortment online and offer more types of shopping experiences. For example, in fiscal year 2018, the retailer launched the high-end Lord & Taylor shop on the site; added 3D virtual shopping in its Home category; launched a sports fan-focused Fanatics shop; introduced a new Nursery destination on Walmart.com; began adding merchandise from its acquired brands to the main website; and launched Walmart eBooks in partnership with Kobo; among other things.

Walmart has also made shipping to your home more affordable. In 2017, Walmart introduced an alternative to Amazon’s pricier Prime membership with free, two-day shipping on orders of $35 or more. This past year, it expanded free, two-day shipping to its marketplace items by working with hundreds of its top sellers and third-party fulfillment providers, like Deliverr.

The company last year also launched a new, more personalized website, which included a revamped Home section, as well as a cleaner, more modern design and sections that showcased items trending in the shoppers’ local area. The redesigned website made it easier to order groceries and reorder favorites, too.

In November, eMarketer noted Walmart had overtaken Apple to become the No. 3 online retailer in the U.S., with Walmart (including its Jet and Sam’s Club brands) poised to capture 4 percent of all online retail by year-end. Amazon, of course, remained No. 1, followed by eBay.

“Progress on initiatives to accelerate growth, along with a favorable economic environment, helped us deliver strong comp sales and gain market share,” said Walmart CEO Doug McMillon, in a statement. “We’re excited about the work we’re doing to reach customers in a more digitally-connected way. Our commitment to the customer is clear – we’ll be there when, where and how they want to shop and deliver new, convenient experiences that are uniquely Walmart.”