请问,问好和点连起来是什么作用 ?.

例如图中的:currentRow?.name

img


还有这种特殊的用法是在哪里学的,就是那种比较官方的文档

可选链操作符

currentRow里有name吗?
有:id: currentRow.name
无:id: undefined

哈哈还有这样写的。
等同于这个。就是 currentRow不为 null 或者undefined 时 id为 它的name属性 。
id: currentRow&&currentRow.name