JavaScript what is a variable containing a variable
The main content of this article is to explain "JavaScript what is a variable containing variables", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "JavaScript what is a variable containing variables" bar!
The JavaScript variable can contain a single value:
Example
Var person = "Bill Gates"
Objects are also variables. But an object can contain many values.
Values are written in the form of name: value pairs (names and values are separated by colons).
Example
Var person = {firstName: "Bill", lastName: "Gates", age:62, eyeColor: "blue"}
A JavaScript object is a collection of named values.
Object attribute
The named value in the JavaScript object is called a property.
Attribute value
FirstName Bill
LastName Gates
Age 62
EyeColor blue
Objects written with name-value pairs are similar to:
Associative arrays in PHP
Dictionaries in Python
Hash table in C
Hash Mapping in Java
Hash in Ruby and Perl
At this point, I believe you have a deeper understanding of "JavaScript what is a variable containing variables". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!