nodejs(二)执行js文件

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u012326462/article/details/83093936

写一个js文件00helloworld.js:

var hello = 'hello world'
console.log(hello)
PS E:\myDocument\nodejs\01> node .\00helloworld.js
hello world
PS E:\myDocument\nodejs\01>

使用 node xxx.js 指令运行,结果输出如上面所示

如果我们输出下面指令,会报错

console.log(window)

同样下面这条指令也会报错:

console.log(document)

所以说node中是没有BOM和DOM的。

猜你喜欢

转载自blog.csdn.net/u012326462/article/details/83093936