React version: "^17.0.2"
Steps To Reproduce
- Create a react app. Introduce redux in it.
- Import that store and provide it in the index.js while rendering the root component.
Link to code example:
The current behavior


Even after the control reaches the let assignment statement, the previous imports are undefined. Could anyone explain why is that so?
Also the following shows that the bundled internal variables are defined though:


Why does this behavior exist in javascript? Is this expected or something different.
Its in mozilla firefox browser (95.0.1)
The expected behavior
Just pls explain why is this happening in the browser (firefox 95.0.1) ? Because of this none of the variables imported have any valid values. How to use them in the file post that lines' execution?
Pl give your answer in a more descriptive manner instead of just saying that this behavior is expected. What is exactly this behavior. If this exists how can anyone use any of the imports in the file below? Whats the purpose of importing something you need above, if it will never get imported even after that line is executed?
As far as I know as javascript is a synchronous language except the specific functionalities like promises, async/await, I guess everything else must be synchronous by its design, which is why this unpredictability in its behavior is confusing.
React version: "^17.0.2"
Steps To Reproduce
Link to code example:
The current behavior
Even after the control reaches the let assignment statement, the previous imports are undefined. Could anyone explain why is that so?


Also the following shows that the bundled internal variables are defined though:
Why does this behavior exist in javascript? Is this expected or something different.
Its in mozilla firefox browser (95.0.1)
The expected behavior
Just pls explain why is this happening in the browser (firefox 95.0.1) ? Because of this none of the variables imported have any valid values. How to use them in the file post that lines' execution?
Pl give your answer in a more descriptive manner instead of just saying that this behavior is expected. What is exactly this behavior. If this exists how can anyone use any of the imports in the file below? Whats the purpose of importing something you need above, if it will never get imported even after that line is executed?
As far as I know as javascript is a synchronous language except the specific functionalities like promises, async/await, I guess everything else must be synchronous by its design, which is why this unpredictability in its behavior is confusing.