The traditional retail sector may be in something of a slump, but Walmart never got that memo.

Walmart, based in Bentonville, Arkansas, reported strong financial results for its second quarter on Thursday. The world’s largest retailer, which has annual revenue of nearly $500 billion, is benefitting from pouring cash into increasing in-store customer experiences, and amping up its online presence, financial analysts say.

Here are some highlights from Walmart’s second quarter earnings report:

  • Revenue, or customer sales, increased 2.1% to $124 billion.
  • Its comparable store sales increased 1.8%. This metric, sometimes referred to as same-store sales, compares the second quarter sales for Walmart stores that have been open for at least one year, to their sales in the same quarter a year earlier. Retailers use same-store sales data to get a clear picture of store performance. This is Walmart’s 12th consecutive quarter of same-store sales increases, according to the retailer.
  • Walmart’s same-store traffic also ticked up 1.3%.
  • The company’s operating expenses, or amount of cash it spent in the quarter, levered up about 4% as it increased expenditures on its ecommerce offering.

Walmart is increasingly going head to head with ecommerce king Amazon, which dominates sales in the online world. Walmart has made significant investments in its own ecommerce offerings in recent years, including through its 2016 purchase of Jet.com for $3 billion, which helped it increase its distribution network for online sales, analysts say.

Both Walmart and Amazon are also competing over grocery sales. Amazon’s recent purchase of Whole Foods signalled its intent to become a serious player in that sector, experts say. Similarly, Walmart gets more than half of its revenue from food sales, which also contributed to strong growth in the quarter, the company said in its earnings report.

Key takeaways: While the retail segment has been in a slump for the past year or more, there are bright spots. Walmart is one of them. The company posted strong earnings for its most recent quarter, thanks to online and grocery sales.

You may also want to read: What to Make of All the Layoffs in the Retail Industry