本文介紹了node.js 顯示“未定義";在控制臺上的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
最近我在我的 Windows 7 機器上安裝了 node.js.
Recently I installed node.js on my Windows 7 machine.
在執行 JavaScript 時,我收到一條 undefined 消息以及表達式的成功執行.
On execution of JavaScript, I get an undefined message along with successful execution of the expression.
這里有什么問題?我沒有注意到任何其他副作用.
What's wrong here? I have not noticed any other side effects.
推薦答案
只要寫 "hello world";
然后回車...它會返回 "hello world"
而不是 undefined
,因此不會顯示 undefined
.console.log
返回 undefined
并將參數記錄到控制臺,以便您獲得多條消息.
Just write "hello world";
and hit enter... it will return "hello world"
instead of undefined
, thus no undefined
is displayed. console.log
returns undefined
and also logs arguments to console so you get multiple messages.
這篇關于node.js 顯示“未定義";在控制臺上的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!