Frage

The standalone V8 shell (d8) does not come with a console object, so I cannot do console.log. How do I print stuff to stdout?

War es hilfreich?

Lösung

Use the print function instead of console.log. For instance:

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

Head over to Sandeep Datta's blog post for more info on d8 helper functions like print.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top