This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by talkgooder
over 9 years

26/28 console throws up the same error (even on codes that previously passed) [solved]

the console is repeatedly throwing up the error “TypeError: string is not a function”.

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

the thing is, even if this code is incorrect. This error is now being thrown up on all previous codes. I haven’t edited them and they worked before. Perhaps my console is unable to reset after a mistake?

update: I was able to solve this problem by going back to the start of the course, reseting every code and retyping it. Will leave this up just in case anyone else has the same problem.

Answer 541682ba631fe9dc1a003285

0 votes

Permalink

@Jottaway, You might also try to reset the browser with F5… Regards,Leon

points
Submitted by Leon
over 9 years

1 comments

talkgooder over 9 years

Thanks for your response. I actually did try reseting my browser, even tried inputting the code on a different browser on a different computer and still had the same problem, this was the only thing that solved it unfortunately

Answer 5419cc80282ae313de003e02

0 votes

Permalink

blarg

points
Submitted by Jerad
over 9 years