JavaScript solves let statement error in code

directory
Question 2. Answer


Problem 1.
Why do we need var instead of let in JavaScript code?

2. Answer
JS version compatibility issues, ECMAScript 6 can be changed.
ES 5; After ES 6, let is used for variable declarations, and const is used for constant declarations. They are used to replace the var declaration method in ES 5.


The original link: https://qwert.blog.csdn.net/article/details/106248417

Read More: