+ 11

My code runs perfectly on my smartphone but doesn't work in the web version of SoloLearn on my computer⁉️🤔 [FIXED]

When I try to run this code on my laptop I get two errors: First after loading & trying to run the code⁉️ SyntaxError: Unexpected end of input at receiveMessage (https://solocode.azurewebsites.net/:315:19) Second after clicking on the button "Next 🌐 Avatar"⁉️ ReferenceError: next is not defined at HTMLButtonElement.onclick (https://solocode.azurewebsites.net/:1:2551) https://code.sololearn.com/WXEmMRkrNa89/?ref=app

21st Feb 2022, 10:10 PM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
17 Antworten
+ 6
ODLNT, Mirielle, FF9900 (off topic) It is very strange but indeed: ... // SoloLearn website Playground // doesn't like single line comments // at the end of the JS code } /* last curly bracket Multi line comments are accepted by SoloLearn website Playground at the end of the JS code */
22nd Feb 2022, 10:04 PM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
+ 5
FF9900 Thx, the code works perfectly both on phone & comp‼️ I've learned a lot‼️😃👍 I strongly believe that you didn't hurt yourself during fixing my snippets⁉️🤔 As a pythonistas, I removed all semicolons from JS code 😀🤣
21st Feb 2022, 11:18 PM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
+ 5
ODLNT Right, everything is 🆗 when you end the code with a blank line. Such code surprises are very difficult to debug and waste your precious time‼️😮
23rd Feb 2022, 8:38 AM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
+ 3
Two things about Sololearn website web playground First: JS tab does not like single line comments at end of code, don't know why? Second: Anything in the JS tab will be wrap in an IIFE. https://code.sololearn.com/WXEmMRkrNa89/?ref=app
21st Feb 2022, 10:33 PM
ODLNT
ODLNT - avatar
+ 2
Solo don't support other tags
23rd Feb 2022, 9:02 AM
Mik
Mik - avatar
+ 1
Mirielle I wish, but I do enjoy using the Sololearn website 😉
21st Feb 2022, 11:52 PM
ODLNT
ODLNT - avatar
+ 1
Janusz Bujak 🇵🇱 It appears I miss spoke somewhat on the single line comment issue. You can use single line comments at the end of the code. It just can't be the last line, meaning you need to add an empty line after the comments. Using the code @FF9900 refactored add an empty line to end of the last comments Run and no more unexpected end of input error messages. Sorry for the confusion
22nd Feb 2022, 11:44 PM
ODLNT
ODLNT - avatar
+ 1
use visual studio seperately instead of using the built in code engine of sololearn imo
23rd Feb 2022, 12:16 PM
sssharks
sssharks - avatar
0
ummm hi prezdent of the underground n on top whats up.|zm.
9th Aug 2022, 11:41 PM
mark michell n w
mark michell n w - avatar
- 3
Hi
23rd Feb 2022, 6:37 PM
Faijullah Khan