26. it says I have a syntax error


#1

var myName = "David"
// On line 4, use console.log to print out the myName variable.
console.log( myName.length)
// On line 7, change the value of myName to be just the first 2
// letters of your name.
console.log(myName.substring(0,2)
// On line 9, use console.log to print out the myName variable.
console.log(myName.substring(0,2)

This is the code I have for 26 and it says I have a syntax error but I'm not sure what it wants me to do in line 7


#2

You have an opening parentheses, but where is the closing one?

console.log(myName.substring(0,2)

You need to make sure for every opening parentheses you have a closing one, like so:

console.log(myName.substring(0,2))

#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.