0
Not the time to work with Node.jsđ€
I have lately started learning JavaScript , and there is a problem at the end of each module test . When I want to solve the problem , the compiler expects me to make a code with Node.js ! While Im not familiarized with that... can't I make one with JavaScript ?đ€
9 RĂ©ponses
+ 2
Ali_combination
As sololearn have a NodeJS playground so it uses that for lessons.
Which doesn't affect anything for you.
You just need to write your logic. That parseInt line will take care of the input.
+ 1
Please elaborate. I can't understand what you want to do?
What code gives you this error?
+ 1
Don't worry about it saying Node.js. Just write your js code as normal and run it. It will work if the code is correct. SL is just using it to check the module projects.
+ 1
The code for the input for this end of module project should have been provided. Anyhow, use this as the first line in the main function.
var depth = parseInt(readLine(), 10);
+ 1
readLine() is a function that reads the input as a string. parseInt() takes a string with a numeric value as the first argument and the base as the second argument. So,
parseInt("123", 10) will return the value 123 as an integer value with a base 10 (decimal). If the 2nd argument was a 2 it would give you the value as a base 2 integer (binary). Where 8 would be an octal and 16 a hexadecimal etc.
+ 1
ChaoticDawg Solved:)) thank you so much dawgâ€
0
ChaoticDawg I think there are a lot of things that I have not learned yet ! Now problem "The snail in the Well" expects me to get an input from user , while I dont know how to get it... I searched for it and found prompt method . It actually recieves a string and I should convert it to an integer by parseInt() (while I have not learned this one either :/ ) . Now I can see that nothing is done in my code because the output is 0 . By the way , looks like prompt() is not defined in Node.js . I think I should have learned Node js before javascript...
0
ChaoticDawg đđđđwhats the use of readline , 10 ? And how can I use it?
0
Krish [less active] Thanks Krishâ€