This article mainly introduces the definition and storage of variables in JavaScript. This article first explains some techniques for variable definition, and then explains the storage of variables, if you need a variable, refer to the following different programming languages, such as C and Java. variables in JavaScript
, first find out if this Key exists, if present, modify this value, if not, then the end of this chain array plus a pair of With the above we can see that the use of hash table storage objects, the time to query the speed is very fast. The left array can be accessed randomly, while the right chain array needs to traver
released by the system after the program ends. The size of the data area is limited by the system and is generally large.4, text constant area: the constant string is placed here, the program is released after the end of the system.5, program code area: the binary code that holds the function body.Based on the knowledge above, it is clear that the size of the area is so small that it cannot save large local variables, it will inevitably overflow, and
Let's look at this example.
Void test (){Char B [25];Printf ("% s \ n", B );B [0] = 'a ';B [1] = 'B ';B [2] = 'C ';B [3] = '\ 0 ';Printf ("% s \ n", B );}For the test function above, what kind of output will be obtained if two consecutive calls are made?
The answer is:
???
ABC
ABC
ABC
This is my actual value. I was confused at the time, why is B a local array? When the function ends, this part of memory is
This section provides a complete JavaScript reference manual:
JavaScript local objects and built-in objects
Browser Object (BOM)
HTML DOM Object
JavaScript Object reference manualThis reference manual describes the properties and methods of each object and provides an instance.
1. Four Basic Data Access Locations in JavaScript: literally, local variables, array elements, and object members. Generally speaking: [literal, local variable] Running Speed gt; [array, object member] 2. Internal attributes include a set of objects in the scope created by
Sparse array and dense array in javascript
When learning about the apis related to the underscore. js array, I encountered sparse array, which I had never touched before.
Here we will learn what sparse arrays and dense arrays are.
What is dense
corresponding value based on the specified name.□Key (index): obtains the name of a specified digit.□Removeitem (name): deletes the name-Value Pair specified by the name.□Setitem (name, value): set a value for the specified name.□Value can be accessed through attribute.3.2 sessionStorage object① SessionStorage objects store data specific to a session, that is, the data is only stored in the browser and closed. Data stored in sessionStorage can be refreshed across pages.② The sessionStorage obje
. localStorage; // return a Storage object. You can call the corresponding method and attribute oStorage. book ="Javascript authoritative guide"; // Add a key value // window. localStorage. book ="Javascript authoritative guide"; // View the key value if (oStorage. book) {alert (oStorage. book);} else {alert (" the key value does not exist ");}
Is the running res
detect arithmetic errors, such as the case of dividing by 0.
Parsefloat () parses a string and returns a floating-point number.
parseint () parses a string and returns an integer.
Vii. Summary
JavaScript is an object-oriented language with the ability to customize objects. At the same time, it can be based on existing objects programming, contains ECMAScript local objects, as a host of the browser runn
Four basic data access locations in 1.JavaScript: literal, local variable, array element, object member.General:[literal, local variable] run speed >[Array, object member] 2. The Internal property contains a collection of objects in the scope in which a function is created.
Client storage of JavaScript and JavaScript I:
Client storage is actually the memory function of the Web browser, and data is stored to the hard disk through the browser API;
Ii. Different storage formats:
1. Web Storage: local
Description
Concat ()
Joins two or more arrays and returns the result.
Join ()
Put all the elements of the array into a string. element is delimited by the specified delimiter.
Pop ()
Delete and return the last element of the array
Push ()
Adds one or more elements to the end of the ar
using tables to save data.The difference between Web storage and cookiesThe concept of WEB storage is similar to a cookie, except that it is designed for larger capacity storage. The size of the cookie is limited, and every time you request a new page, the cookie is sent past, which virtually wastes bandwidth, and the cookie needs to specify the scope and cannot
1. How data is stored1. Literal2. Variables3. Array items4. Object Members2. Respective performance characteristics1. The fastest access to literals and local variables, and relatively slow access to array items and object members2. Because local variables start at the scope chain, accessing
19th Chapter Client Storage
1.cookie
① was originally used by the client to store session information.
1.1 Limit
①cookie are bound to a specific domain name in nature. This cookie is included when a cookie is set and a request is sent to the domain name where it was created.
②cookie Restrictions:
-ie6 and lower versions limit up to 20 cookies per domain.
-ie7 and later versions each domain name up to 50 cookies.
-firefox50 A
-opera50 A
-safari and Chr
Common Array Operations and JavaScript operations in javascript
As follows:
Tip: Right-click to open the new tab.
The following describes the operations of array object traversal, reading/writing, sorting, and array-related string processing in
= "globalVariableValue2";
THIS.G = "GlobalVariableValue3";
Console.log (THIS.E);//undefined
Console.log (THIS.F);//globalvariablevalue2
Console.log (THIS.G);//globalvariablevalue3
Delete F;Delete g;Console.log (THIS.F);//undefinedConsole.log (THIS.G);//undefined
For every function call in JavaScript, JavaScript creates a local object to store
Four basic data access locations in 1.JavaScript: literal, local variable, array element, object member.
In general: [literal, local variable] run speed >[Array, object member]
2. The Internal property contains a collection of objects in the scope in which the function is
Local JavaScript variable
A variable declared inside a JavaScript function (using VAR) is a local variable, so it can only be accessed within the function. (The scope of the variable is local).You can use local variables with the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.