About 2,320,000 results
Open links in new tab
  1. JavaScript Variables - W3Schools

    Variables are containers for storing values. All JavaScript variables must be identified with unique names. These unique names are called identifiers. Identifiers can be short names (like x and y) or more descriptive names (age, sum, totalVolume). The general rules for constructing names for variables (unique identifiers) are:

  2. Variables - Learn web development | MDN - MDN Web Docs

    Apr 15, 2025 · What variables are and why they are so important. Declaring variables with let, initializing them with values, and reassigning with new values. Creating constants with const. The difference between variables and constants, and when you …

  3. How to Declare Variables in JavaScript – var, let, and const …

    Nov 7, 2023 · Through this article, you will learn how to declare and mutate variables using var, let, and const, and you'll get a better understanding of the differences between them. I will explain each concept in two parts: Let's dive into these different ways of declaring variables in JavaScript so you know how they work and when to use each one.

  4. how to access element whose id is variable - Stack Overflow

    Nov 22, 2012 · I need to access elements in html file using javascript, their names are like arr_1, arr_2, arr_3, I wish to use a loop to dynamically create the id then to access them like below: var id = "arr_" + i; $document.getElementById('id').... But it doesn't work. I remember there is an function to allow me do that, anyone know what that is?

  5. JavaScript Variables – A Beginner's Guide to var, const, and let

    Nov 30, 2020 · In JavaScript, you can declare variables by using the keywords var, const, or let. In this article, you’ll learn why we use variables, how to use them, and the differences between const, let and var. What are variables used for in JavaScript? In the context of coding, data is information that we use in our computer programs.

  6. Grammar and types - JavaScript | MDN - MDN Web Docs

    Apr 7, 2025 · JavaScript borrows most of its syntax from Java, C, and C++, but it has also been influenced by Awk, Perl, and Python. JavaScript is case-sensitive and uses the Unicode character set. For example, the word Früh (which means "early" in …

  7. JavaScript var Statement - W3Schools

    Variables are containers for storing information. Creating a variable in JavaScript is called "declaring" a variable: After the declaration, the variable is empty (it has no value). To assign a value to the variable, use the equal sign: You can also assign a …

  8. JavaScript Variables - GeeksforGeeks

    Jan 29, 2025 · Variables in JavaScript can be declared using var, let, or const. JavaScript is dynamically typed, so variable types are determined at runtime without explicit type definitions. 1. JavaScript var keyword.

  9. Variables - The Modern JavaScript Tutorial

    Feb 14, 2024 · Variables are used to store this information. A variable is a “named storage” for data. We can use variables to store goodies, visitors, and other data. To create a variable in JavaScript, use the let keyword. The statement below creates (in other words: declares) a variable with the name “message”:

  10. JavaScript.com | Variables

    var is the keyword that tells JavaScript you’re declaring a variable. x is the name of that variable. = is the operator that tells JavaScript a value is coming up next. 100 is the value for the variable to store. After you declare a variable, you can reference it by name elsewhere in your code.

  11. Some results have been removed
Refresh