The length of DOMTokenList for JS returns the number of tokens.
tokenlist.length
add
contains
item
remove
replace
supports
toggle
value
Web Hypertext Application Technology Working Group (WHATWG)