This forum is now read-only. Please use our new forums! Go to forums
3.5 "Missing ;" error on line 5
var isLost = function (n) { for(i=0, i<count, i++) { if ( n === lost[i]) { return true }; }; return false; };
That is my code starting on line 5 But even when I reset the code to how it starts, there is an error on line 5 saying “Missing ; “ and if I try to run the code, it says: “Syntax Error: Unexpected token )” I’ve been working at it for a while and I cant figure it out
Answer 4fd8b2e54dacfa00030280e3
var lost = [4, 8, 15, 16, 23, 42]; var count = lost.length;
var isLost = function (n) { for (i=0; i<=42; i++) { if ( n === lost[i]) { return true; } } return false; };
Answer 4fd8ac9381e21500030278ca
Looks like you need to separate the initialization of the for loop with semi-colons instead of commas
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