+ 1

Why is simple code in JavaScript resulting to error in code playground?

https://code.sololearn.com/cVJzZydD9HC6/?ref=app

28th Jan 2022, 8:22 AM
Paschal Chidera Anusi
Paschal Chidera Anusi - avatar
4 Answers
+ 2
Anusi Chidera Paschal This is Node JS Use console.log instead of document.write
28th Jan 2022, 8:41 AM
AÍąJ
AÍąJ - avatar
+ 2
Thank you AJ I really appreciate
28th Jan 2022, 8:46 AM
Paschal Chidera Anusi
Paschal Chidera Anusi - avatar
+ 1
document.write() might work if your node.js code is inside a html file in a browser. Instead of document.write() use console.log() if you need a new line or process.stdout.write() for printing in the same line.
28th Jan 2022, 8:48 AM
Mario Paes
Mario Paes - avatar
+ 1
Thanks Mario Paes
28th Jan 2022, 9:16 AM
Paschal Chidera Anusi
Paschal Chidera Anusi - avatar