Node.js的helloworld 程序

用文本編輯器,如npp,鍵入如下代碼,存儲成hello.js

console.log('hello')
console.log('hello %s->%d','jeapedu', 1941847311)

console.log('hello')
console.log('hello %s->%d','jeapedu', 1941847311)
node hello.js
C:\nodeS>node hello.js
hello
hello jeapedu->1941847311

cmd進入dos,切入hello.js所在目錄,執行node.js程序

node hello.js

運行結果如下所示:

C:\nodeS>node hello.js
hello
hello jeapedu->1941847311







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章