Everything looks fine with this small piece of code as shown in the screenshot. Yet, I am getting the syntax error around {
. Please tell me what might be causing it?
-
this is your custom code?– DevidasCommented May 12, 2020 at 17:43
-
Yes, it is. I am keeping a check here before calling a function defined in some other JS file.– CodeForGoodCommented May 12, 2020 at 17:55
-
can you upload js code here? then i check– DevidasCommented May 12, 2020 at 18:00
Add a comment
|
1 Answer
Javascript is case sensitive. Just change "If" to "if".
Examples:
- This works:
if (1) { console.log('hey') }
- This doesn't work:
If (1) { console.log('hey') }