0
How to solve?
What is the solution of -'7.3 practice problem in javascript'
10 Answers
+ 5
Sourya Banerjee Here in the code above you have used "document.write" function which is used to give output on the document not in the console.
To output the value of "p" in the console you need to use "console.log(p);".
Rest of the code is perfect.
Happy Coding đ€
+ 3
Show your code first.
We want to see what have you written?
+ 2
document.write() is DOM related, front-end stuff and only available for front-end JS.
Back-end JS e.g. Nodejs doesn't have access to DOM and therefore only allows output through logging into the console e.g. console.log()
It depends where you're doing this ...
+ 2
Sourya Banerjee The code you've given here is working just by changing document.write to console.log....
I've checked it!
+ 1
const readline = require('readline');
var computers = parseInt(readLine(), 10);
var p= computers*2;
document.write(p);
+ 1
They are asking which is not taught till now
+ 1
What's the issue?
+ 1
What is the question
it's for pro
I can't access
copy paste the question
+ 1
In you code written above
1st line is for node js file module. Don't worry about that. That file module is used to read input from the user
var computer is holding your input
var p will have value twice of var computer
last line is used for printing the value of variable p
try using console.log(p)
0
Oo... thanks but they are still not taking the solution