1/26 Change variable values


#1

Where is the problem in these code. I really don't understand. Please help...

// On line 2, declare a variable myName and give it your name.
var myName = "Zishan";
// On line 4, use console.log to print out the myName variable.
console.log(myName);
// On line 7, change the value of myName to be just the first 2
// letters of your name.
myName = "Kbshan";
// On line 9, use console.log to print out the myName variable.
console.log(myName);


#2

you want to use substring on line 7 to print out the first two letters of your myName variable


#3

thanks your reply. but actually I could not understand. Can you make coding for me? please..


#4

No, codecademy policy prevents me. I can only help. Could you show an updated version of your code?


#5

infact i could not understand your answer.

**// On line 7, change the value of myName to be just the first 2
// letters of your name.
myName = "Kbshan";
// On line 9, use console.log to print out the myName variable.
console.log(myName);**

on line 7, just written change the value of variable myName just first 2 letter.
So, I changed but error is being come?
I cannot be able to understand this error.


#6

you only want to print the first two characters of your name, so you can call substring on your myName:

myName.substring(0,2);

now you just need to make sure that is log to the console


#7

thank you som much... now solved....