0

Can't use document.write

Is not defined shows the compiler

8th Feb 2021, 5:39 PM
Marcelo Diaz
Marcelo Diaz - avatar
3 Réponses
0
it works, may be you have something mistyped. https://code.sololearn.com/WA3DJMFkcprI/?ref=app
8th Feb 2021, 6:20 PM
Bahhaⵣ
Bahhaⵣ - avatar
0
document is defined only inside browsers for html documents (web: html/php)... if the error you get is about document is undefined, then you're probably in a nodejs project (else it's not js), where there's no document (so no method document.write), and you should use console.log (wich is also available in browsers) method to do output ;P
8th Feb 2021, 8:51 PM
visph
visph - avatar
0
Thanks
10th Feb 2021, 2:52 AM
Marcelo Diaz
Marcelo Diaz - avatar