Changing variable values


"Declare a variable Myname and give name"

"print the myname variable"

"change the value of myname to be just first 2 letters of your name"

print the myname variable"

Error:didn't log the first two letter of your name o the console

the above code will not work please help
error comes in thirdline


To figure out what you need to change you'll need to start by identifying what it is doing differently from what you want it to be doing.
Right now it's unclear what you want to change, can't tell what you want help with!


You've changed a letter in your name. The instructions say "//On line 7, change the value of myName to be just the first 2 letters of your name." so it should be "ja". Now, remember substring? You need to set myName to myName.substring(0, 2). So the answer is myName = myName.substring(0, 2)


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