gpt4 book ai didi

v8 - 带有独立 V8 (d8) 的 console.log

转载 作者:行者123 更新时间:2023-12-04 02:22:01 26 4
gpt4 key购买 nike

独立的 V8 shell ( d8 ) 没有 console对象,所以我不能做 console.log .如何将东西打印到标准输出?

最佳答案

使用 print函数而不是 console.log .例如:

$ cat test.js
print('foo');
$ ~/src/v8/out/native/d8 test.js
foo

前往 Sandeep Datta's blog post有关 d8 的更多信息辅助函数如 print .

关于v8 - 带有独立 V8 (d8) 的 console.log,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22284207/

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