Hey, im having a problem with console.log at the moment. This is pretty much my first time learning console log and I don’t understand what’s going on here. Ive looked up lots of things trying to fix it myself but I can’t find a solution. what am I missing?
let name = “tuscanny” ; // 'name' is defined here. You need quotes around the string you want to use
console.log(“name”); // 'name' is used here. NO QUOTES!!!!
Oh ok im getting it now. So this is what I get when I implement those changes. is this correct? the first line says tuscanny. is it only supposed to say this? are there no other identifying factors that tuscanny is a return value of a console log???
To be technical, "tuscanny" is not the ‘return value’ of console.log(). The string "tuscanny" was logged to the console. console.log() prints stuff to the console, but it does not have a ‘return value’.
ok I get that. that makes sense. Thanks for your help! this was actually driving me up the wall for a about and hr 30. I think my main lack of understanding was the quotations over name in the console.log. that was messing me up bad. Now I get that a string needs quotes when being defined, but the variable from there on will not use the quotes more or less correct?
In addition to the taking out the quotes around the variable in the console.log, you were still getting an error with the curly quotes around your string. I changed them to straight quotes in testing that and got it to log correctly.
Im still having issues with console.log on a to-do list tutorial that im working on… not sure why. It seems that If I define the variables inside the console, the console log will work but if I console log the variable in my editor I get an error saying the variable that im logging is not defined. Im very confused.
yes thank you.here is my code for the todo list that im working on. having problems getting it to work and have no idea why im having troubles counsel logging. its my first time doing console logs.