How to get the last item in a javascript-value object with a for loop?

后端 未结 6 2221
长情又很酷
长情又很酷 2021-02-07 06:11
var obj = { \'a\' : \'apple\', \'b\' : \'banana\', \'c\' : \'carrot\' }

If I do a

for(key in obj) {
  console.log( key + \' has a value         


        
6条回答
提交回复
热议问题