Many retailers are in a world of pain because of Amazon. Walmart is not one of them.

It beat Wall Street forecasts for sales and profit on Thursday and improved its forecast for holiday shopping. The stock rose nearly 11% to an all-time high.

What's most impressive about this is that Walmart (WMT) is doing it the Amazon way -- with sizzling online growth.

Walmart, which owns Jet.com, ModCloth, Bonobos, Moosejaw and several other shopping sites, said its digital sales rose a stunning 50% in the United States during the third quarter.

That's more than double the growth rate that Target (TGT) just posted for online sales. It's higher than Amazon's growth rate for revenue, too.

Walmart has made a big bet on digital.

It recently bought Parcel, a logistics startup that will allow Walmart to launch same-day delivery services for online purchases in New York City.

Related: Cool or creepy? Walmart to deliver to your home...and come inside to put everything away

It's working with the smart-lock company August Home on a test program that will let you order food from Walmart and have the delivery people come and put it away in your fridge.

And Jet recently launched a line of household products targeted at millennial shoppers called Uniquely J.

Walmart also revamped its return policy to make it easier and faster for customers to start the return process using the Walmart app.

And Walmart is taking a page from Amazon's book by selling other retailers' products on its own site. Walmart recently announced that it will sell clothes from Lord & Taylor.

The company is thriving in China as well. Sales from Walmart and Sam's club locations there are solid, and online growth is robust thanks to a partnership with the Chinese e-commerce firm JD.com (JD), the top rival to Alibaba (BABA).

Related: Target's holiday outlook isn't very merry

This and other initiatives are helping boost traffic and sales at Walmart's physical stores, not just its digital sites. And Wall Street has noticed.

Shares of Walmart are up about 45% this year, while other big retailers like Target, JCPenney (JCP), Macy's (M) and Sears (SHLD) have plunged.

It seems investors and shoppers alike are increasingly viewing the online mass-merchandise battle as one with two winners -- Walmart and Amazon (AMZN) -- and many losers. Amazon's stock has soared more than 50% this year.

Walmart is also holding its own in the supermarket business, posting solid sales growth, particularly online. That's despite an increased threat from Amazon, which now owns Whole Foods and has been cutting that chain's prices.

Related: Walmart is putting even more robots on its stores

There may be room for some other specialty retailers to thrive.

Best Buy (BBY) disappointed Wall Street on Thursday with sales that missed forecasts and a tepid outlook, but its stock is still up nearly 30% this year.

Home Depot (HD) is benefiting from the housing boom, partly because homebuilders and do-it-yourself customers want to see its products in a brick-and-mortar store. Kiddie apparel company Children's Place (PLCE) has enjoyed solid sales, too.