This forum is now read-only. Please use our new forums! Go to forums
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
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
1 comments
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