0
点赞
收藏
分享

微信扫一扫

nodejs(二)执行js文件

毅会 2022-10-25 阅读 45


写一个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)

nodejs(二)执行js文件_node执行js

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

console.log(document)

nodejs(二)执行js文件_node执行js_02

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

 

举报

相关推荐

0 条评论