Common development knowledge points of ES6: detailed explanation of let and const commands

let command Basic Usage { let a = 10; var b = 1; } a // ReferenceError: a is not defined. b // 1 According to the above results, the variables declared by let are valid only in the code block where it is located. Example 1: var a = []; for (var i = 0; i < 10; i++) { a[i] = function () { consoleUTF-8...

Posted by ginga8 on Mon, 18 Apr 2022 02:51:31 +0930