Puzzled error… an identifier is already declared in DevTools

I am using an example to learn decorator in JS. When I run the the example code below as a snippet in Chrome DevTools, I got an error msg:

Uncaught SyntaxError: Identifier ‘wrapped’ has already been declared
at :1:1

However, when I use Node.js to run the same code in terminal, everything is fine. Changing the variable name from const wrapped = loggingDecorator(doSomething); to const hello = loggingDecorator(doSomething); told me it’s not the problem b/c the error simply became:

Uncaught SyntaxError: Identifier ‘hello’ has already been declared
at :1:1

Anyone has an idea what’s going on?

function doSomething(name) {
  console.log('Hello, ' + name);
}

function loggingDecorator(wrapped_func) {
  return function() {
    console.log('Starting');
    const result = wrapped_func.apply(this, arguments);
    console.log('Finished');
    return result;
  }
}

const wrapped = loggingDecorator(doSomething);