SyntaxError - Not sure why

Not exactly sure why this is kicking back the SyntaxError. Looked it up, but cant seem to wrap my head around whats creating the error. My code looks to me exactly like the solution, so I have to be missing something. If anyone can explain what im missing that would be fantastic!

Console kicks back:

SyntaxError: unknown: Missing semicolon. (9:33)

   7 |   // Only change code below this line
   8 |   const failureItems = [];
>  9 |   for (i = 0, i < arr.length, i++) {
     |                                  ^
  10 |     failureItems.push(`<li class="text-warning">`${arr[i]}`</li>`);
  My Code so far

const result = {
success: ["max-length", "no-amd", "prefer-arrow-functions"],
failure: ["no-var", "var-on-top", "linebreak"],
skipped: ["no-extra-semi", "no-dup-keys"]
function makeList(arr) {
// Only change code below this line
const failureItems = [];
for (i = 0, i < arr.length, i++) {
  failureItems.push(`<li class="text-warning">`${arr[i]}`</li>`);
// Only change code above this line
return failureItems;

const failuresList = makeList(result.failure);

Challenge: Create Strings using Template Literals

Link to the challenge:

Did you declare i?

Yeah, i caught that after posting.
Tried declaring i within the for loop:

for (let i = 0, i < arr.length, i++) {

and console kicks back:

SyntaxError: unknown: Identifier 'i' has already been declared. (9:20)
>  9 |     for (let i = 0, i < arr.length, i++) {
     |                     ^

Declaring it before the for loop still kicks the original SyntaxError.

Trace back to the symbol immediately before the one highlighted.

You have nearly the correct syntax, but commas have a different syntactic meaning than semicolons.

Hi @ElasticFox ,
Just in case your problem is not solved.
I have some references for you to solve your problem.

for loop
JS template literal

Pay attention to the syntax of the examples.
Good luck!

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