A stock market sell-off in 2022 has tanked the share prices of some of the world's most valuable companies, creating an excellent time to invest in growth stocks like Amazon (AMZN 0.75%) and Apple (AAPL 0.58%). These companies are known as leaders of their respective industries, yet have watched their stocks suffer double-digit declines over the past year.

Regardless, Amazon and Apple continue to have great long-term outlooks, making both of their stocks worth an investment. However, if you're only looking to add one stock to your portfolio, you might wonder which is the better buy. So, let's assess. 

1. Amazon

Amazon has come a long way since starting out as an online book retailer in 1994, expanding into several lucrative industries. The company's stock has plummeted 46% since January amid macroeconomic headwinds. However, its diverse business has continued to see revenue growth in 2022, a promising sign for its future.  

In the third quarter of 2022, Amazon's revenue rose 14.7% year over year to $127.1 billion, with operating income coming in at $2.5 billion.

In its e-commerce business, the company's North American segment increased by 20% to $78.8 billion, and its international revenue decreased by 5% to $27.7 billion. However, its earnings abroad primarily suffered from changes in foreign exchange rates, resulting in a strong dollar. Thus, Amazon's international revenue rose 12%, excluding exchange fluctuations.

The bright spot of Amazon's year amid an economic downturn has, no doubt, been its cloud computing business, Amazon Web Services (AWS). The platform's segment made up 100% of the company's operating income in Q3 2022, with revenue increasing 27% year over year to $20.5 billion.

While a potential recession in 2023 could lead to further declines in its e-commerce business, AWS's continued growth over the last year proves it will likely continue flourishing no matter the economic climate and prop the company up through a possibly challenging year.

However, according to the Federal Reserve, consumer spending has risen for the last three quarters. If this continues on its current trajectory, Amazon could see a return to operating income in its e-commerce business next year, along with continued growth in AWS.

2. Apple

Despite falling 21% year to date, Apple stock has risen 228% over the last five years, making it one of the best growth companies out there. By comparison, Amazon's stock has increased by 55% in five years. 

In a year plagued by tech industry declines, Apple has reported strong sales for its products. In the fourth quarter of 2022, the company's iPhone revenue increased by 9.6% to $42.6 billion despite worldwide smartphone shipments decreasing by 9.7%, according to IDC. 

Similarly, the company's Mac segment reported growth of 25.3% year over year, hitting $11.5 billion, while worldwide PC shipments fell 15%.

Apple has attracted investor concern over the last month because of its dependence on China for iPhone production as the smartphones made up 52% of the company's revenue in its fiscal 2022. COVID-19 restrictions in the country have strained production and motivated Apple to begin diversifying its iPhone manufacturing.

The company is now making a portion of its iPhone 14s in India, with JP Morgan Chase estimating that about 25% of all Apple's products will be produced there by 2025. It could take years for Apple to move out of China completely; however, that doesn't dampen its long-term prospects. 

In addition to diversifying its product manufacturing, the company has a swiftly growing services business that could alleviate pressure from its iPhone segment. As Apple's second-biggest segment in its fiscal 2022, services revenue rose 14% year over year to $78.1 billion. By contrast, iPhone revenue increased by 7% during the year.  

Regarding key metrics for Amazon and Apple, Amazon's price-to-earnings ratio is at 84, rising 27% in the last year. Meanwhile, Apple's is about 23 after declining 24% since last December.

In terms of free cash flow, Amazon's stood at a negative 26.3 billion as of Sept. 30, while Apple's came in at $111.44 billion. 

Amazon continues to have an excellent outlook over the long term. However, Apple has fared far better in 2022, and the stock currently offers more value. Additionally, the company's ability to keep up stellar demand for its products in a poor economic climate makes its stock undoubtedly a more reliable and better buy.