What is an empty in the js array?

I use v-for to loop through several groups, input radio, select the radio in the first group, and put its value into the array. If it is not selected in the array, that is, empty, the empty is not an empty string or anything, it still occupies the length. How can I judge it? for example, when I walk through the array and encounter empty, I alert 123

.
Mar.01,2021

Don't use for in to traverse the array normally. The value of other traversal methods is undefined.


clipboard.png


typeof would be fine

the other way you traverse is undeifned instead of null empty

Menu