我只是偶然发现了this line of TS code:
const { title = item.text } = item;它看起来是一个destructuring assigment,但是花括号中的赋值是做什么的?
发布于 2019-11-15 12:59:17
内部赋值提供了一个default value
在item.title未定义情况下,将改为为title分配item.text。
https://stackoverflow.com/questions/58870565
复制相似问题