How do you add a string value to a variable?


// Declare a variable on line 3 called
// myCountry and give it a string value.
var myName = "myCountry"

// Use console.log to print out the length of the variable myCountry.

// Use console.log to print out the first three letters of myCountry.

im on 25 and this is the code. im not sure what to do with: var myName = "myCountry"
i have looked up many things, checked my code and searched online.nothing came up.
im stuck and i need to learn in detail on how to give a variable "string value".


In direct answer to the question,

   new_value = "string value" + variable;


You are declaring the variable myName instead of myCountry.

var myCountry = "yourcountry"


Thanks, however, the feedback I get is that I am not declaring length.
So, the problem is that it will not accept my statement regarding length.

//use console.log to print out the length of the variable myCountry

console.log ("myCountry.".length)

This is the way we dealt with length previously, but now it won't accept that format.I don't know why.


We can store a string value in a variable.

var my_var = "some string value";

It's not the name of the variable we are focused upon, but the value it refers to.


Notice there are no quotes. They are only ever used to delimit an actual string primitive.

"string primitive in quote marks"