About 27,700,000 results
Open links in new tab
  1. javascript - What is the difference between "let" and "var"? - Stack ...

    Apr 18, 2009 · If you're writing server-side JavaScript code (Node.js), you can safely use the let statement. If you're writing client-side JavaScript code and use a browser based transpiler (like …

  2. javascript - Does JS have "if (let foo ... - Stack Overflow

    Sep 1, 2023 · Clojure has an if-let. That would be handy for cases like this. You could probably make a function that does this effect if you find yourself needing this a lot.

  3. Why was the name 'let' chosen for block-scoped variable …

    Jun 20, 2016 · I understand why var takes that name - it is variable, const - it is a constant, but what is the meaning behind the name for let, which scopes to the current block? Let it be?

  4. In JavaScript, why should I usually prefer 'const' to 'let'?

    Dec 11, 2016 · Why most of the time should I use const instead of let in JavaScript? As we know if we use const then we can't reassign value later. Then why not use let instead of const?

  5. javascript - What is the difference between 'let' and 'const ...

    If you use const, that variable name will always reference the same object. 2) let is block-scoped, while var is function-scoped. In other words, if you use let inside an if-statement the variable …

  6. When should you use "var", "let", or "const" in JavaScript code

    Apr 13, 2023 · Closed 2 years ago. New to JavaScript and a beginner. I came across JavaScript variables and realized there are three different ways to go about them (var, let and const). Do …

  7. javascript - let keyword in the for loop - Stack Overflow

    ECMAScript 6's let is supposed to provide block scope without hoisting headaches. Can some explain why in the code below i in the function resolves to the last value from the loop (just like …

  8. javascript - When should I use let and var? - Stack Overflow

    Feb 20, 2014 · I understand the difference — var is for function scoping while let is for block scoping—but I'm looking for something like "always use the let keyword" or "use the var …

  9. javascript - Linguistic meaning of 'let' variable in programming ...

    So, I'm a javascript programmer and the new version of JavaScript (ES6) has a new keyword for declaring variables: let, next to the old one var. I know the difference between these two, but I …

  10. ¿Cual es la diferencia de usar LET en vez de VAR en JavaScript?

    let permite declarar variables limitando su alcance (scope) al bloque, declaración, o expresión donde se está usando. Lo anterior diferencia la expresión let de la palabra reservada var , la …