Issue with the label syntax which jumping to the top of the code


#1

I am trying add a label at the top of the code as below:
startAgain :
var userChoice …

I am using a siwtch case to jump to the specifed label if draw or incorrect input by user but codecademy is creating a problem with the label statement.


#2

Please post:

code
exercise url
error mesasge


#3

Exercise Rock Paper Scissor :
https://www.codecademy.com/en/courses/javascript-beginner-en-Bthev-mskY8/1/5?curriculum_id=50b3b2201e0a31cfe4000b4f

In the code for the condition when user is entering wrong input, I am displaying an error message and redirecting the program control back to the top of the code to start again with a fresh input.

But as soon as I am writing the label at the top it is showing label statement error.
My label name is startAgain
And I am writing “startAgain:” without quotes at the top of the code


#4

That is the old learning environment, which is no longer supported. Please update to one of the supported courses:

https://www.codecademy.com/learn/learn-javascript
https://www.codecademy.com/learn/introduction-to-javascript

You didn’t share your code, so its impossible to say. The exercise is just for me to get quick access to the lesson, it will load my own code (it checks for the user that is signed in)


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.