music.playsong = function(vars){
//vars is an array with a Key named "song"
youTube.search(vars["song"], 2, function(error, result) {
if (error) {
console.log(error)
return;
}else {
console.log("Success")
return result
}
})
}
我目前在調用這個函數作爲返回從回調變量爲定義函數的NodeJS
music.playsong(data)
然而,在此功能,我不能訪問底層的回調,並從該值。我如何得到這個music.playsong()返回回調的結果沒有阻止執行?