Skip to main content

Uncaught SyntaxError: Identifier 'CODE' has already been declared

Error Uncaught SyntaxError: Identifier 'CODE' has already been declared occurs when you try re-declared const in javascript. It cannot be updated or re-declared

  • Uncaught SyntaxError: Identifier 'CODE' has already been declared

    const CODE = 7;
    //const CODE = 20;

    You have to remove the const CODE = 20 or const CODE = 7  from script. Because you can not redeclare the const in javascriipt because you already declared it. It will throw an error - Uncaught SyntaxError: Identifier 'CODE' has already been declared.

  • Back to code snippet queries related javascript