Problem with exercise 26


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.
// 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.


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


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



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


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


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