26.Change variable values


#1

I get "Oops, try again. There was a problem with your syntax."

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


26.Change variable values.Sorry i need help again!
#2

@shirleysound Only use one equal sign (=) when declaring a variable.

Next time, or if you still need help, please create a new topic rather than using someone else's.

Thanks!


#3

When you use "="
it makes (declares) the thing ON THE RIGHT over to the thing ON THE LEFT.
var thingOnLeft = "right";
so if you printout thingOnLeft it will print "right".

if you use "==" or "==="
you are comparing the thing ON THE RIGHT to the thing ON THE LEFT.
var x = 5;
var thingOnLeft = 5;
if (thingOnLeft === x){
// stuff will be printed here because thingOnfLeft IS equal to x)
}