Code Project 4 - prompt | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Code Project 4 - prompt

Why doesn't prompt work here, yet works just fine in my code bit inventory???

30th Dec 2023, 10:39 PM
Shapa
Shapa - avatar
14 Answers
0
Yes you're right, because in the code project you are using nodejs, not the web! You cannot use prompt() in nodejs, instead you should install libraries like prompt, or readline-sync, which you cannot do such a thing here in Sololearn. Well, what's the solution!? 🤔 I don't know!! 😐 No, I'm not kidding I really don't know what to do, well I solved that 2 years ago, so I can't remember how did I do that, Sololearn has changed from 2yrs ago til now, so I don't know what do 😄😄 But we can ask help from Lisa...
31st Dec 2023, 4:12 PM
🇮🇱 Radin Masiha 🇮🇱
🇮🇱 Radin Masiha 🇮🇱 - avatar
+ 3
I think I recently reported the same issue to sololearn. Was it in Introduction to Javascript? What happens when you click "Reset code" in the 3 dots menu?
31st Dec 2023, 4:18 PM
Lisa
Lisa - avatar
+ 2
How can we help you when you haven't posted your code!!?
30th Dec 2023, 11:17 PM
🇮🇱 Radin Masiha 🇮🇱
🇮🇱 Radin Masiha 🇮🇱 - avatar
+ 1
Language?
31st Dec 2023, 5:09 AM
A͢J
A͢J - avatar
+ 1
Shapa, it is working properly, what do you want it to be like?
31st Dec 2023, 3:50 PM
🇮🇱 Radin Masiha 🇮🇱
🇮🇱 Radin Masiha 🇮🇱 - avatar
+ 1
@Radin Masiha This same code won't work in project 4 though, I keep getting errors.
31st Dec 2023, 3:53 PM
Shapa
Shapa - avatar
+ 1
When you press "reset" it just clears entire code
31st Dec 2023, 4:18 PM
Shapa
Shapa - avatar
+ 1
Shapa node js doesn't have prompt function. It is a function of Javascript.
31st Dec 2023, 6:49 PM
A͢J
A͢J - avatar
0
The language is Javascript in the code project 4 module https://sololearn.com/compiler-playground/W0CFi0Qc3ttl/?ref=app
31st Dec 2023, 2:55 PM
Shapa
Shapa - avatar
0
I've tried parseInt and many. Still didn't work.
31st Dec 2023, 4:14 PM
Shapa
Shapa - avatar
0
It is not because of parseInt, prompt is not supported as user input
31st Dec 2023, 4:17 PM
🇮🇱 Radin Masiha 🇮🇱
🇮🇱 Radin Masiha 🇮🇱 - avatar
0
Well, I guess there's no solving this.
31st Dec 2023, 4:19 PM
Shapa
Shapa - avatar
0
Shapa, you are right, this is while it said the code to get the user input is already present. I think you should report this bug by sending a feedback to Sololearn, explaining your problem short and clearly. Anyway, code projects aren't required to be solved; your code is correct, you have understood the concept (just note that you should parseInt your ans 😉), so continue learning. GOOD LUCK.....
31st Dec 2023, 4:23 PM
🇮🇱 Radin Masiha 🇮🇱
🇮🇱 Radin Masiha 🇮🇱 - avatar