【发布时间】:2018-10-02 22:19:17
【问题描述】:
我正在使用一个名为 Twit 的 NPM 包来获取关注特定 Twitter 用户的 ID 列表
T.get('followers/ids', { screen_name: 'kanyewest' }, function (err, data, response) {
console.log(data)
})
输出:
root@box:/var/app/twitterbot# screen -r twitterbot
793990194311626800,
902628660292837400,
937381447303823400,
966061750650069000,
143239761,
396278761,
949690872429387800,
880529987392204800,
142651429,
31053983,
757696951659921400,
879346525666762800,
1651454588,
927660101279903700,
737929151907287000,
933093234590466000,
114504331,
1104837235,
... 4900 more items ],
next_cursor: 1598483705781998800,
next_cursor_str: '1598483705781998810',
previous_cursor: 0,
previous_cursor_str: '0' }
但是,如果我这样做:
T.get('followers/ids', { screen_name: 'kanyewest' }, function (err, data, response) {
console.log(data[1])
})
我不确定。
我做错了什么?
【问题讨论】:
-
console.log(data, response)的输出是什么; -
@MarcosCasagrande 此处粘贴时间过长pastebin.com/Cnti1Fqx
标签: javascript arrays node.js object indexing