关于ES6的可选链操作符?.(比如获取对象的值) 2022-04-20 本文已影响0人 泪滴在琴上 你可能会这么做: const name = obj && obj.name; 使用E6的可选链操作符: const name = obj?.name;