Apple Inc. is overcoming the costly global shortage in computer chips, posting record sales over the holiday quarter, beating profit estimates and forecasting that its shortfall is narrowing. The iPhone maker, which is world’s largest company by market capitalization, has handled supply-chain challenges such as factory shutdowns and shipping delays brought on by the pandemic better than any of its top peers, analysts said. Apple shares rose about 5 percent in after-hours trading, erasing half their losses on the year. The gains came after the company teased its ambitions for augmented reality in the metaverse. More people wanted iPhones, iPads, and other gadgets over the holiday quarter than Apple had to sell, costing the company over $6 billion in sales, or in line with what it feared. Yet, Apple, which is many part suppliers’ biggest client, used its buying power to squeeze those vendors to ship enough gadgets to power …