JS Introduction[Three ways of JS]1. Embedded JS in HTML tags Ha ha 2, the HTML page directly using JS3. Referencing external JS file[Precautions]① page JS code and Reference JS code, you can mosaic to any location of the HTML page. But the different
Global scope of this this = = window //truethis. A = 8 window.a// 8This of the general functionfunction thistest () { returnthis = = = Window //true function thistest () { ' use strict ' returnthis = = = Undefined //trueThe this in
Chapter III: Basic ConceptsThere are 5 simple data types (also known as basic data types) in ECMAScript:Undefined\null\boolean\number\string, There is also a complex data type --object,object essentially consists of a set of unordered name-value
There are 5 data types in javascript: undefined, null, Boolean, number, String, and typeof to detect the data type.1 undefined:undefined There is only one value, that is Undefined, when declaring a variable with VAR but not initializing it, this
Recently has been in a written interview, often encountered such as 123== ' 123 ',' abc ' ==true and other issues, including the correct answer, there is also wrong, the main reason or the ECMAScript of the norms did not understand clearly, Many
Undefinedindicates that the variable has been declared but has not been initialized. It should be noted that when the TypeOf operator is used to determine the data type, the values returned by the undeclared and uninitialized variables are undefined
The interview the day before yesterday, the interviewer asked a super simple topic:
"True==3" returns Nothing.
I blurted out, true, without hesitation. , because there is an implicit type conversion, 3 is converted to true, so the last return is
1. Type analysis :The data type in JS has 5 kinds of undefined,boolean,number,string,object, the first 4 is the original type, and the 5th type is reference.Code
Copy Code code as follows:
var A1;
var a2 = true;
var a3 = 1;
var
*1, Variable type:JavaScript is a weak type, a variable can store any type, and the run-time type is variable;-> variables can be converted to type;*/
/*2, Variable declaration:*/var i;var index;var i, index;var i = 0, index = 2;/*Variable
JavaScript basic syntax
1, operator
An operator is a sequence of symbols that completes an operation, and it has seven classes:
Assignment operators (=,+=,-=,*=,/=,%=,>=,|=,&=), arithmetic operators (+,-, *,/,++,--,%), Comparison operators (>,=,==
With the popularity of Ajax applications, the JavaScript language gets more and more attention. Developers are also increasingly using JavaScript. JavaScript is no longer just used to add some fancy effects to the page, it has become an important
1.window. JsonJson.parse (text [, Reviver]); = = text: A valid JSON string is required; Reviver: optional, handler function; returns null or undefined when the member of text is removed; typically used to convert a string to a JSON
DescriptionECMA (European Computer Manufacturing Association)?? The ECMA (European Computer Manufacturing Association) defines the ECMA-262 specification. The International Organization for Standardization (ISO/IEC) also adopted ECMAScript as the
This article mainly introduces the difference between null and undefined in JavaScript, this article gives a number of code examples to explain the difference between them, the need for friends can refer to the
There are two original types in
JavaScript variables, scopesThe data types of JavaScript are divided into basic data types and reference data types,1. The basic data types include NULL, Undefined, Number, Boolean, and string types, and these five basic data types can be determined
Nan represents a result of an operation that does not produce normal results. It does not equal any value, including its own. Can be detected with isNaN (number).
Like a string in Java, the string in JS is immutable. This means that once a string
1, the understanding of JSA, developed by Netscape (Netscape) b, which is a cross-platform scripting language C, applied to Web pages, to operate the browser and Web content D, JavaScript was originally designed to verify the correctness of HTML
Nan represents a result of an operation that does not produce normal results. It does not equal any value, including its own. Can be detected with isNaN (number).
Like a string in Java, the string in JS is immutable. This means that once a string
Chapter Catalogue:
JS basic knowledge (above)--explain the JS basic grammar-related questions, analysis principles and solutions. This chapter explains the first part of the basics: types and calculations of variables. And JS "Three
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.