Skip to content

Category: Questions

Jquery ajax usage for object

I was trying to complete project on fcc.Didn’t know how to add quotes in html.Looked up in their premade project found this piece.Can someone explain what is going on in this code? Answer It’s a hack to get around an incorrect Content-Type. gist.githubusercontent.com isn’t designed to host J…

How to detect if the script is trying to add the two same IDs?

I’m trying to make a logger for IDs and names, but I can’t seem to detect if the script is trying to add the two same IDs. I’ve tried id.includes(user._id), but it always passed the if test. Here’s the code: Answer You can search your id array with find this will give you the current o…

Generate random letters “H” and “V” n times

I have a really specific problem and can’t think of an answer. I have a function to generate a letter H or V. I want to make that if the generator exceedes the limit for H to pick V and if the limit for V gets exceeded to pick H. Example Limit for H is 10 Limit for V is