我有一些我不完全理解的代码行。我期待通过一个API对象,想知道什么是[I]的目的d2.follows [I] .user.display_name如果代码是:for循环中的[i]的用途
$.getJSON(followerURL, function(d2){
for(var i=0; i<d2.follows.length; i++){
var displayName = d2.follows[i].user.display_name;
following.push(displayName);
我通过对象搜索到找到一个频道拥有的关注者人数。是Here is an image of the object我会非常感谢这段代码的解释。
'folows'是一个数组,'folows [i]'是这个数组的一个元素。什么是问题? – diavolic
d2.foolows是一个对象数组 –
它从数组“d2.follows”中访问元素编号“i”。 – Nisarg