26 Oops, try again. There was a problem with your syntax


#1

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

I don't see anything wrong with it though, can anyone help me out?


#2

Hi this part

var.myName = "Cr"

First you should put a space between var and myName like that

var myName =

And for printing the first two letter of your name use substring() like that

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

#3

Thanks a lot, var.myName = "Cr" was the problem, the thing you mentioned with substrings was actually incorrect though, as it was telling me to change the variable, rather than print the first two letters. Thanks for helping me!


#4

@craig.russell,

Reference

google search
== the Book ==
javascript [your question] site:developer.mozilla.org

== discussions / opinions ==
javascript [your question] site:stackoverflow.com

== guidance ==
www.crockford.com
http://javascript.crockford.com/code.html <---JavaScript code-convention
http://javascript.crockford.com/survey.html
https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript
www.developer.mozilla.org/en-US/docs/Web/JavaScript/Guide