Today I decided to compete in an online programming contest using JavaScript for the first time but It got me in trouble! My local version of Nodejs was v10.16.1 but the online judge used V8 JavaScript engine.
Until today I thought Nodejs uses V8 as JavaScript engine; however unfortunately I can't use readline
and print
built-in functions of d8 in Nodejs today.
So Does Nodejs support V8 by default?
- If no, how can I install d8 alongside Nodejs and how can I use it?
- If yes, how can I enable it?
Any response would be appreciated...
Edit: As far as I realized, that online judge isn't embedding V8; It just uses d8 as it's environment which is a shell (interface) for V8 and readline
and print
are the built-in functions of the d8 (not V8).
Edit: This question is related to using JavaScript in online contests. Also this one is helpful for how to use d8.