Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 1
Can someone help me with a personality test? (JavaScript)
Iām trying to make a personality quiz but have hit a dead end (Iām no so good with JavaScript). How can I use the if else statement to change the next question based on the users answer? eg. the quiz is about TV shows: the first question would be ādo you like comedy?ā, if the answer is āyesā, it should show āhave you ever watched a sitcom?ā, though if the answer is ānoā, than the next question would be ādo violent scenes bother you?ā.
1 Resposta
+ 1
Not especially from the JavaScript view, but I don't think, you should use if-else-branches at all. If the flow is completely determined, you should rather store all questions as objects, with an attribute pointing to the respective previous answer.