Why "document.write" is not defined | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why "document.write" is not defined

function main() { var depth = parseInt(readLine(), 10); //your code goes here var count = 0 var sum = 0 while (sum < depth){ sum += 7 sum -= 2 count++ } document.write(count); }

23rd Sep 2021, 8:32 AM
yoel
3 Answers
+ 4
yoel Node js doesn't have document.write use console.log
23rd Sep 2021, 8:36 AM
A͢J
A͢J - avatar
+ 2
or use console.info Keep learning & happy coding :D
23rd Sep 2021, 9:24 AM
SoloProg
SoloProg - avatar
+ 1
oh i thought i didn't spell it right
29th Aug 2022, 8:34 AM
Arun CS
Arun CS - avatar