js的for循环换一种写法总是报错

想试一下js的另一种for循环但是总报错,Uncaught TypeError: Cannot read properties of undefined (reading 'firstElementChild')

img

用of遍历,不是in,in的值只是数组的下标,并不是遍历每一项的值

img

trs[tr]

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632