An economic downturn in 2022 dragged down countless stocks, with the Nasdaq Composite tumbling 33% throughout the year. However, the market has enjoyed a solid recovery in 2023 alongside easing inflation. The index has climbed 29% since Jan. 1.

The improvement has some analysts calling a bull market. However, it's not a bad idea to exercise caution, as many companies continue to feel the effects of macroeconomic headwinds. As a result, now is an excellent time to strengthen your portfolio with stocks that make smart buys, no matter the market conditions.

So, here are two stocks I'd buy with no hesitation, especially in a Nasdaq bear market.

1. Apple

Whether you're new to stock trading or a seasoned veteran, you probably have Apple (AAPL -0.70%) on your radar. The company has achieved record heights in tech, becoming the first to hit a market cap of $3 trillion earlier this year.

Apple's focus on quality and its ecosystem of products has garnered almost unrivaled brand loyalty. Its success with consumers has led to dominating market shares in many of its product categories, fortifying its business during challenging market conditions. 

Apple shares are down 9% since the start of August after the company posted its earnings results for the fiscal third quarter of 2023, ended July 1. The company suffered from reductions in consumer spending on tech. However, the dip has only made its stock more attractive as it continues to outperform its peers.

According to Counterpoint Research, U.S. smartphone shipments fell 24% year over year in the second quarter of 2023. Samsung and Motorola experienced sales declines of 37% and 17%. However, the same period saw Apple's iPhone sales tumble a more moderate 6%, while its market share increased from 52% to 55%. 

The company performed similarly against its PC competitors. Data from IDC shows PC shipments fell by 13% in Q2 2023. Sales for Dell and Lenovo Group decreased by 22% and 18%. Yet, the quarter saw Apple shipments actually increase by 10% as it was the only company in IDC's data set to report growth. 

Consumers have proved time and time again their preference for Apple products, allowing it to charge a premium for its offerings. Its higher-priced products have strengthened its business and made it one of the most reliable investments. Consequently, its stock is a no-brainer in a bear market and one I'd buy without hesitation. 

2. Amazon

While Apple dominates consumer tech, Amazon (AMZN -3.65%) has a similar command in e-commerce. Its powerful position in the industry proved challenging during last year's economic downturn, leading to steep declines in its retail earnings. However, a solid recovery this year has demonstrated the resilience of Amazon's business model and its worth as a long-term investment. 

In 2022, Amazon's e-commerce segments reported combined operating losses of $10.6 billion as online spending faltered. However, the first half of 2023 has seen growing profits. In the first quarter, Amazon's North American segment returned to profitability, and in the second quarter, it hit over $3 billion in operation income. Meanwhile, its international segment has continued to improve over both quarters. 

It's always best to judge a company by how it reacts under strain rather than suitable conditions. Last year, Amazon's profit losses led it to close or cancel construction on dozens of warehouses, shutter unprofitable services such as Amazon Care, and lay off thousands of workers. The restructuring paid off this year and proved the reliability of Amazon's business and stock over the long term. 

Moreover, the company is home to the world's largest cloud platform, Amazon Web Services (AWS), which gives it a powerful position in the future of artificial intelligence (AI). The company is heavily investing in the high-growth sector, recently announcing several new AI-enabled tools to AWS and a venture into chip development. 

The combination of dominating market shares in e-commerce and the cloud industry and solid leadership during economic hurdles make Amazon's stock an attractive investment. And if a bear market has put the company's shares on sale, Amazon is a screaming buy.