Semicolon is missing

I have validated code but it is missing semicolon.

let trans = () => {
 document.documentElement.classList.add('transition');
 window.setTimeout(() =>
  {
   document.documentElement.classList.remove('transition')
  }, 1000
 );
}

Misisng ; before statement. Even if I put ; before statement it will not be validated with without an error.

Need help.

Try one at the end of the 5th line, and another after the last }.

2 Likes

-I have tried and the following still does not work:

let trans = () => {
 document.documentElement.classList.add('transition');
 window.setTimeout(() =>
  {
   document.documentElement.classList.remove('transition');
  }, 1000
 );
};

Can you please let us know what validator you are using.

Is it flagging this error on the let trans line? If so, you might need to look at the line before it…

It could be a code editor’s validator that doesn’t like ES6. That’s why I’m wanting to learn further details about the validator that’s reporting the problem.

1 Like

Perhaps you can also explain what this means. What does it do that it should not do, or what does it not do that it should do?

I’m sorry for words: does not work. I mean validation reported FALSE signal. I have not tested working condition. I’m using Webuilder app for all Javascript validations.

Is it the JavaScript menu bottom option called JSHint JavaScript Checker that you are using for validation?

If yes - what ECMAScript version is being set for it?
If no - please provide further details about your JavaScript validation.

Hi there Paul,

“WeBuilder” uses “JSHint JavaScript Checker”,
with these observations…

  1. ECMAScript 5
     
    ‘let’ is available in ES6 (use ‘esversion: 6’) or Mozilla JS extensions (use moz).
    ‘arrow function syntax (=>)’ is only available in ES6 (use ‘esversion: 6’).
    ‘arrow function syntax (=>)’ is only available in ES6 (use ‘esversion: 6’).
    ‘trans’ is defined but never used.
  2. ECMAScript 6
     
    ‘trans’ is defined but never used.

…if that helps. :winky:

coothead

Yes, I have webuilder too. The problem coothead though is that the OP’s report of the problem differs from those observations. So there’s something that we are not being told.

Thank you for all messages.

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