+ 3
Need help with SL api
https://code.sololearn.com/Wj19CZi7D04s/?ref=app Can I have an example code plz?
4 ответов
+ 8
Hello there! :)
I changed a bit your code and now it's working :)
https://code.sololearn.com/WfDLevapDYdb/?ref=app
I added relevant tags where I modified your code. If it's not clear, I can try to explain it more detailed :)
+ 2
「HAPPY TO HELP」 and Twin Chick 🐣🐣🐣🐤🐤🐤🐥🐥🐥 it's because userId is given a number value on line 6. You can't call includes on a number.
+ 2
You are trying to assign an integer value to the string variable userId ☺️
It should be: userId = "21344701"
You can shorten the code:
var userId = prompt("Enter your id (Leave it blank if you want MY id.)") || "21344701";
+ 2
Twin Chick 🐣🐣🐣🐤🐤🐤🐥🐥🐥 You might want to do some error handling with this. If I enter a string value in the prompt, there's an uncaught error on line 22. In fact, all the lines below that (apart from window.onload obviously) will fail because you won't have a userDetails property on the data you get back.