About 150,000 results
Open links in new tab
  1. JavaScript Const - W3Schools

    When to use JavaScript const? Always declare a variable with const when you know that the value should not be changed. Use const when you declare: A new Array; A new Object; A new …

  2. const - JavaScript | MDN - MDN Web Docs

    Mar 19, 2025 · const begins declarations, not statements. That means you cannot use a lone const declaration as the body of a block (which makes sense, since there's no way to access …

  3. JavaScript const - GeeksforGeeks

    Feb 12, 2025 · The const keyword in JavaScript is a modern way to declare variables, introduced in (ES6). It is used to declare variables whose values need to remain constant throughout the …

  4. JavaScript const: Declaring Constants in ES6 - JavaScript Tutorial

    ES6 provides a new way of declaring a constant by using the const keyword. The const keyword creates a read-only reference to a value. By convention, the constant identifiers are in …

  5. 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 …

  6. JavaScript const Statement - W3Schools

    Creating a variable in JavaScript is called "declaring" a variable: A const variable must be assigned when it is declared. Required. The name of the variable. Required. A value to be …

  7. What does Const Do in JavaScript - GeeksforGeeks

    Jun 5, 2024 · const keyword in JavaScript is primarily used for declaring constants. The value of a const variable cannot be reassigned after initialization. Example: This example shows the …

  8. JavaScript const Keyword: A Complete Tutorial with Examples

    The const keyword in JavaScript is used for declaring variables that you don’t want to be reassigned. It is a best practice to use const for variables that should not change to make your …

  9. JavaScript Const: Constant Variable Declaration and Usage

    Aug 20, 2024 · In this comprehensive guide, we'll dive deep into the world of const, exploring its intricacies, best practices, and real-world applications. The const keyword in JavaScript is …

  10. JavaScript const Keyword Explained with Examples - sebhastian

    Oct 27, 2023 · Today, I will teach you how the const keyword works in JavaScript works and when you should use it. The const keyword is used to declare a variable that can’t be changed after …

  11. Some results have been removed
Refresh