gpt4 book ai didi

node.js - node.js 交互式 shell 中的窗口对象

转载 作者:搜寻专家 更新时间:2023-11-01 00:39:13 25 4
gpt4 key购买 nike

我安装了 node.js v6.9.1 并输入了 window 但只收到一个错误。在 Chrome js 控制台中,window 打印“window”,如果您单击三角形链接,您可以看到所有 window.whatever 功能。如何使用 Node shell 获得相同的结果?

谢谢。

最佳答案

你不能。 Node 中没有窗口。窗口是浏览器的一部分,在 Node 中完全没有。

Node Shell 被称为 REPL

Window (from MDN)

The window object represents a window containing a DOM document; the document property points to the DOM document loaded in that window.

关于node.js - node.js 交互式 shell 中的窗口对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40900720/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com