Problem with exercise 26


#1

Hello everyone, I'm currently having trouble with exercise 26. My code is right (I think) but it's not passing me, it keeps coming up with this error: "SyntaxError: Unexpected token ("

Can anyone help figure out the problem? Thanks in advance!

P.s - I've refreshed the browser twice and it still won't pass me.

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

#2

You were asked twice to print out the myName variable, but you have used two different codes to achieve this:

console.log(myName);
console.log.(myName);

The second dot in the last line of your code is unwanted. Function calls always follow this syntax:

functionName(parameters...)

#3

Thank you! I feel so dumb for not seeing that!


#4

You're very welcome :slight_smile: It happens to everyone, really :slight_smile:


#5

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