Problem description: The code snippet (below) is not working for some reason. I don’t know if this is a glitch or something, because when I do it, it says id or name can not be defined.
Code snippet:const userid = getUserInfo(id) and const user = getUserInfo(name)
Expected behavior: Find the userid and username.
Actual behavior: Error in console: id or user is not defined.
Looking at your code, you seem to misunderstand what the getUserInfo function does. It gets the user info from a http request, meaning you cannot get the information of a random user using their name or id. You should use it like this: