Error take another look at the hint


#1

var myName = "Jack";

console.log("myName");

var myName = "Jack".substring(0,2)

console.log("myName");
this is what I put in and it keeps saying error take another look why not look at the hint and that doesn't help at all any ideas?


26. Javascript Change variable values
#2

Please do not hijack dead topics but rather create your own question if you have a problem. For your code at least one problem seems to be that you're not really using the variable. The idea of a variable is that you can store data in it and use this data by using the variable name as an alias for the value so e.g.

var myName = "Jack";

stores the value "Jack" in the variable myName, meaning that you can from now on use myName as an alias for "Jack" and that you can easily change the value of myName by using myName = newValue.

so where

console.log(myName)

would print Jack console.log("myName") just prints the word "myName". So be careful if you want a word use "" or '' but if you want to use the variable just write the variable name.