DEV Community

Discussion on: ✒️ JavaScript syntax mini quiz

Collapse
 
paulooze profile image
Pavol Porubský

For clarification, <varname> = throws an error in 'strict mode' which means you can't use them inside type="module" scripts, as they are in strict mode by default (source: developer.mozilla.org/en-US/docs/W...).

Collapse
 
lazerfx profile image
Peter Street

Definitely - and that's one reason using 'strict' is a massively good thing to do :D Or, perhaps better, use TypeScript and benefit from a more deliberate variable declaration syntax.