I'm looking at some code in an existing project and came across a js file containing one line:
declare var __DEV__: boolean;
There is a syntax error that says:
Expected ; but found var
I tried removing the declare to change the line to:
var __DEV__: boolean;
which gives the error:
Expected ; but found :
I've also read this post to understand how declarations work and confirm that it's necessary for this part of the code. I then compared the code to examples found here and couldn't pinpoint the mistake.
I considered changing the variable name, or declaring it differently, but I would like to understand how to do this correctly.