«   Previous tip Next tip   »

Chrome DevTools: Redeclare let and class statements in the Console Panel

Last updated: 20th July 2020
Redeclare let and class statements in the Console Panel

You can now redclare let and class statements in the Console Panel for easier prototyping and experimenting of JavaScript code.

Previously, if you entered the following in the DevTools Console Panel:

let variable = 1
// Press Enter ⏎

let variable = 2
// Press Enter ⏎

You would see an error message: Uncaught SyntaxError: Identifier 'variable' has already been declared.

DevTools now supports this redeclaration for both let and class statements.

«   Previous tip Next tip   »

Sign up to receive a developer tip, in the form of a gif, in your inbox each week