English 中文(简体)
为什么在节点. js 中没有定义? 在主控台之后, hello world example after control. log
原标题:why undefined in node.js hello world example after console.log
  • 时间:2012-05-26 07:00:58
  •  标签:
  • node.js

我刚刚开始使用 node.js 。 所以, 从Hello World 举例开始, < a href="http://www.nodebeginner.org/" rel="noreferr">node.js Birstner book 。 当我输入命令 conole.log ("哈洛世界"); 。 它的指纹Hello World on Control.

i 从此链接安装窗口的节点 : < a href=> "https://github.com/joyent/node/wiki/Installation" rel=“ noreferrer” > 窗口的节点安装

下面的截图也是此的截图

""https://i.sstatic.net/99vzz.png" alt="此处输入图像描述"/"

最佳回答

每个 JavaScript 函数都返回某东西。 当您像这样定义函数时 :

function test() {
    var x = 1;
}

后是 test () return undered . . undered . or.log 函数。它所做的是将参数传到显示中。然后是全部。它返回了 undeed

现在节点JS shell 的工作方式是,每当输入函数、变量等时,它就会显示它返回的值。 因此, connoole.log (Hello World!) ; pass hello world! to the screen and return undered , 然后是节点JS shell 显示的 。

或多或少它是如何工作的。

问题回答

暂无回答




相关问题
How to make Sequelize use singular table names

I have an model called User but Sequelize looks for the table USERS whenever I am trying to save in the DB. Does anyone know how to set Sequelize to use singular table names? Thanks.

What is Node.js? [closed]

I don t fully get what Node.js is all about. Maybe it s because I am mainly a web based business application developer. What is it and what is the use of it? My understanding so far is that: The ...

Clientside going serverside with node.js

I`ve been looking for a serverside language for some time, and python got my attention somewhat. But as I already know and love javascript, I now want learn to code on the server with js and node.js. ...

Can I use jQuery with Node.js?

Is it possible to use jQuery selectors/DOM manipulation on the server-side using Node.js?

How do I escape a string for a shell command in node?

In nodejs, the only way to execute external commands is via sys.exec(cmd). I d like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a ...

热门标签