It's the end of the year, and that means Wall Street firms put out their top stock picks for 2024. Doug Anmuth, an analyst at JPMorgan Chase, the nation's largest bank by assets, revealed a few businesses that he believes are ready to reward investors over the next 12 months.

Among the list, you'll find two FAANG stocks. Both had fantastic performances in 2023, and they could keep up the momentum and be unstoppable winners in 2024.

Here's why it's a good idea to buy Amazon (AMZN -1.07%) and Alphabet (GOOGL -0.77%) (GOOG -0.75%) right now.

Strength of the consumer

The first reason to be bullish on these companies is because of how resilient consumers have remained. Both Visa and Mastercard confirmed in their latest quarterly earnings calls that consumer spending has stayed robust, despite inflationary pressures and high interest rates.

A strong consumer certainly benefits Amazon because it can lead to greater e-commerce and retail spending on the marketplace, especially since the store represents 40% of online sales. Revenue gains have accelerated in the past three quarters, so the momentum is already there.

In Alphabet's case, robust consumer spending can have a more indirect impact. People might be browsing the internet more often for things to buy, which can help digital advertising revenue. Moreover, if marketing executives think it's worth it to target consumers, they can direct their budgets to Google. Again, the likely result would be more ad sales.

Since Amazon generated over $12 billion of revenue from digital advertising, an improving ad market can help it as well.

Rightsizing operations

After many companies registered monster growth and expansion during the depths of the pandemic, 2023 has been one in which executives have focused on streamlining their operations. This means huge reductions in employee headcounts as well as tighter cost controls.

Amazon and Alphabet laid off tens of thousands of workers in the last year or so. And we're seeing the benefits to the bottom line. Both businesses posted wider operating margins in the latest quarter compared to the year-ago period.

Of course, shareholders don't want to see these companies sacrifice long-term growth opportunities in the name of financial prudence. However, it's good to see management driving greater efficiencies.

The artificial intelligence wave

Besides cost cuts, the key theme of 2023 was how businesses are positioning themselves to benefit from the artificial intelligence (AI) boom. Experts believe this new technology is set to disrupt a range of industries.

As massive tech corporations with seemingly endless financial horsepower and the ability to attract top workforce talent, Amazon and Alphabet are likely to be leaders in the AI revolution. Both offer products and services that touch the lives of millions (or perhaps billions) of customers daily, so they can quickly introduce new features that can gain broad adoption. Moreover, they have the data advantages to continue getting better.

With Amazon Web Services (AWS), Amazon is already making moves. Bedrock allows AWS clients to create their own generative AI applications. Amazon has also partnered with Anthropic, an AI start-up, to collaborate on the development of more AI training models.

Alphabet CEO Sundar Pichai said that the business will be an "AI-first" company. This means updates to Gmail, Maps, and Photos, for example, that bolster the user experience. Plus, the recent introduction of the company's AI model, Gemini, could have huge implications.

What about valuation?

Based on their performances in 2023, you'd assume that both Amazon and Alphabet would be trading at expensive valuations. But that's dead wrong.

Currently, Amazon sells for a price-to-sales ratio of 2.86, below its 10-year average. And Alphabet sells for a price-to-earnings ratio of 26.89, also below its 10-year average. In fact, both stocks look undervalued relative to the recent past.

It seems like now is a great time to add these dominant businesses to your portfolio.