About 14,400,000 results
Open links in new tab
  1. Const in JavaScript: when to use it and is it necessary?

    Jan 20, 2014 · I've recently come across the const keyword in JavaScript. From what I can tell, it is used to create immutable variables, and I've tested to ensure that it cannot be redefined (in Node.js): const ...

  2. 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?

  3. Are there constants in JavaScript? - Stack Overflow

    Sep 25, 2008 · Is there a way to use constants in JavaScript? If not, what's the common practice for specifying variables that are used as constants?

  4. Proper use of const for defining functions - Stack Overflow

    Are there any limits to what types of values can be set using const in JavaScript, and in particular, functions? Is this valid? Granted it does work, but is it considered bad practice for any reason?

  5. What is the difference between const and const {} in JavaScript?

    Dec 9, 2016 · const { email,title } = obj; This is ES6 syntax-the simpler one It will automatically assign the email and title from obj; just the name has to be correctly stated for the required field.

  6. javascript - What is the difference between "let" and "var"? - Stack ...

    Apr 18, 2009 · ES6 introduced JavaScript developers the let and const keywords. While let and const are block-scoped and not function scoped as var it shouldn’t make a difference while discussing their …

  7. How to create Javascript constants as properties of objects using const ...

    Jun 1, 2012 · How come constants cannot be set as properties of objects which are variables themselves? const a = 'constant' // all is well // set constant property of variable object const …

  8. var, let, const... o nada en Javascript - Stack Overflow en español

    Si utilizas javascript a secas, tienes que hacer uso de var, ya que en los navegadores viejos no pueden tomar const y let. Las variables o constantes globales son las que se pueden acceder desde …

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

    @rohan-patel 1) const is making the binding (or ‘link’) between the name of a variable and an object constant. If you use const, that variable name will always reference the same object. 2) let is block …

  10. constants - const keyword scope in Javascript - Stack Overflow

    Sep 5, 2012 · const defines a constant (in supporting browsers). Why would you expect to be able to change it? JavaScript will not throw an exception if you try to change the value of a const, but will …