Let htmlCollection be an HTMLCollection {} such that,
Object.keys(htmlCollection) is [‘0’, ‘1’, ‘2’]
Object.values(htmlCollection) is [ HTMLDivElement {}, HTMLDivElement {}, HTMLDivElement {} ]
Using tslib <= 2.2.0
[ …htmlCollection ] gives [ HTMLDivElement {}, HTMLDivElement {}, HTMLDivElement {} ]
Using tslib 2.3.0
[ …htmlCollection ] gives [ HTMLCollection {} ], where HTMLCollection {} is the same as htmlCollection
Similar behaviour is observed for NodeList {}.
Let
htmlCollectionbe anHTMLCollection {}such that,Object.keys(htmlCollection)is[‘0’, ‘1’, ‘2’]Object.values(htmlCollection)is[ HTMLDivElement {}, HTMLDivElement {}, HTMLDivElement {} ]Using tslib <= 2.2.0
[ …htmlCollection ]gives[ HTMLDivElement {}, HTMLDivElement {}, HTMLDivElement {} ]Using tslib 2.3.0
[ …htmlCollection ]gives[ HTMLCollection {} ], whereHTMLCollection {}is the same ashtmlCollectionSimilar behaviour is observed for
NodeList {}.