Uncaught SyntaxError: Identifier 'CODE' has already been declared

Updated at 25-Sep-2021, By samar

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

    <script> 
    const CODE = 7;
    </script>
    //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