0

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?

enter image description here

3
  • this is your custom code?
    – Devidas
    Commented 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. Commented May 12, 2020 at 17:55
  • can you upload js code here? then i check
    – Devidas
    Commented May 12, 2020 at 18:00

1 Answer 1

1

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') }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.