I wrote a code as below and the system says “Your declaration should end with a semicolon.” But I don’t did and even ChatGPT says it’s correct. So I don’t understand why the system says so. Can anybody help me pass?
let character = ‘hello’ ;
Your code so far
// User Editable Region
let character = 'hello' ;
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 2
Your code is not passing because you should be declaring a variable (character) but you shouldn’t assign it a value at this point. You should use the same syntax as the example given in the instructions.
As for semicolons… as per the note in the challenge description:
Note : It is common practice to end statements in JavaScript with a semicolon. ;
It is not strictly necessary to include semicolons when writing Javascript but there’s a good reason for the convention.