Lesson 26 changing variable values


#1

please help i am stuck on 26 changing variable values i keep getting this message " It looks like you didn't log your whole name to the console."


#2

@panganai,
Could you present the code you are using ...??!!


#3

I am getting the about the same error (Oops, try again, It looks like you didn't log the first 2 letters of your name to the console!).

The code I am using:
var myName = "Brandy"
console.log(myName)
myName = "Martin"
console.log(myName)

The Display shows:
Brandy
Martin


#4

I have the same problem:

// On line 2, declare a variable myName and give it your name.
var myName = "Felipe";
// 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.substring(0,1);
// On line 9, use console.log to print out the myName variable.
console.log(myName);


#5

@felipestoker,

// On line 7, change the value of myName to be just the first 2
// letters of your name.
myName = myName.substring(0,2);

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring


#6

To be honest, I fount the mistake:
// On line 2, declare a variable myName and give it your name.
var myName = "Felipe";
// 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.
console.log(myName.substring(0,2));
// On line 9, use console.log to print out the myName variable.
console.log(myName);


#7

@felipestoker,

change the value of myName to be just the first 2 letters of your name.
myName = myName.substring(0,2);


#8

var myName = "yourname";

console.log(myName);

myName = myName.substring(0,2);

console.log(myName);