const targetIndex = thispuInfo && thispuInfochannels thispuInfochannels0index 0;用中文解释一下这段代码
这段代码的意思是如果存在puInfo和puInfo的channels属性,则将puInfo的channels属性的第一个元素的index属性赋值给targetIndex变量;否则将targetIndex变量赋值为0。其中,?符号表示可选链操作符,可以避免当puInfo或channels不存在时出现的错误。
原文地址: https://www.cveoy.top/t/topic/bE3w 著作权归作者所有。请勿转载和采集!