0
我有這樣的CoffeeScript代碼推到一個列表
emails = []
for mail in profile.emails
emails.push mail.value
if !emails[0]
options =
url: "https://api.github.com/user/emails?access_token=" + accessToken
headers:
"user-agent": "zmgc.net"
Accept: "application/vnd.github.v3"
request options, (error, response, body)->
unless error
try
user_emails = JSON.parse body
email = user_emails[0].email
console.log email
emails.push email
catch ex
return done(ex)
當我進入if !emails[0]
,並試圖將值推到郵件列表中,我得到一個空字符串時,沒有得到結果!
我錯過了什麼?