K
K
KIberWarriorJs2022-01-22 13:27:05
Node.js
KIberWarriorJs, 2022-01-22 13:27:05

Why does node js think the variable is already declared?

Hello everyone, I'm new to node.js and faced this situation:
There are two files in the same folder and each of these files has a variable if the first file already has it, then the second file does not allow it to be declared because it thinks that it is already declared Cannot redeclare block-scoped variable 'a' . Can anyone explain why this behavior is happening?const a = 2
const a
61ebe4b2aeb52125836877.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question