In the first example, using var, the variable declared in the loop is redeclaring the variable outside the loop.
In the second example, using let, variables declared in a loop do not redeclare variables outside the loop.
If let is used to declare i variables in a loop, i variables can only be seen in loops.
If the user is undefined, no error will occur (architecture # 5). Also, since it is not JavaScript, you can not set a breakpoint on {{this expression}}. Let's go one step further. Errors that occurred in JavaScript are captured by internal angle interceptors and interpreted as catch errors by the browser (everything that occurred in AngularJS, held by AngularJS). Therefore, you need to turn on pause with the exception that caught the flag (the debugger stops all exceptions, but you need to be aware of not only uncaught exceptions). Initialize (You figured out the wrong architecture # 6) before you can reach the real exception. After that, the following stack trace will be displayed.
Oh, Babel is a converter that allows you to target specific versions of JavaScript, and you can encode it to any version of JavaScript. You do not need to include Babel to use ReactJS, but otherwise you should still use ES5 to make us real. - Yes, as you know, the script standard JavaScript created in 1999, after its first release in 1995, was executed only in Netscape Navigator with JavaScript named Livescript. At that time it was very confused, but fortunately the current situation is very clear. There are seven versions of the implementation.
JavaScript was developed by Brendan Eich in 1995, originally called LiveScript. LiveScript was released with Netscape Navigator 2.0 and renamed to JavaScript using Netscape Navigator 2.0 B 3. JavaScript is an interpreter client-side scripting language that allows web designers to insert code into their web pages.