We often see some data types in javascript, such as "undefined", "boolean", and "string, this article will help you learn the basic JavaScript data types, value types, and reference types. For more information, see this article, four basic data
JavaScript is a weakly typed language, which is a typical example of a variable that can be assigned to any type when it is used. So let's take a look at JavaScript, which has a way of using these variable types already. Let's take a look at the
JavaScript is a weakly typed language, which is a typical example of a variable that can be assigned to any type when it is used. So let's take a look at JavaScript, which has a way of using these variable types already.Let's take a look at the
Do you know the value of alert following JavaScript execution?
var foo = 1;
function Bar () {
if (!foo) {
var foo =;
alert (foo);
}
Bar ();
If you're surprised by the result of "10," you might want to take a good look at this article:
var a =
Value: The operation of a computer program requires the operation of the value (values).
Data type: A type that can be represented and manipulated is called a data type.
Variable: When the program needs to save the value for future use, it assigns
Now we have reached the core point of this article. The execution context code is divided into two basic stages for processing: Enter
Now we have reached the core point of this article. The execution context code is divided into two basic stages for
positive 0 vs minus 0
Two values are almost identical except as divisor:
var zero = 0; Positive 0
var negz =-0; Minus 0
Zero = = Negz; True
1/zero = = 1/negz; False
"JavaScript Authority Guide" p.37undefined VS null
Undefined is
This article mainly introduces the types, values, and variable Summary of JavaScript. You can refer to the following: JavaScript data types are divided into two types: primitive type and object type. Five primitive types: Numbers, strings, Boolean
1) Intro
Not long ago I set up a technology group in a MM asked a question like this, she posted the code as follows:
var a = 1;function hehe (){Window.alert (a);var a = 2;Window.alert (a);}Hehe ();
The results of the execution are as follows:
If the variable is related to the execution context, the variable should know where its data is stored and how to access it.
During JavaScript programming, we can't avoid declaring functions and variables to build our system successfully. But how
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.