How to get the index value in for in. Give an example.

 var array={name:11111,age:18,xing:""}
       
        for(index,xd in array){
            // console.log(array[index])
            console.log(index)
            
        }
    
Jul.13,2021

your array is an object, and there is no index. It can't be accessed by index, it can only get Key.

.

if you want to get the KV value, just honestly use the method you commented out, and some suggestions

  

syntax is wrong. What is for (index in array) {.}
xd ? Why is there still ", "?
check the most basic questions before posting, which is completely careless.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e431c9-44a0f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e431c9-44a0f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?