Brief Introduction
(1) To facilitate operation of basic type values, ECMAScript also provides 3 special reference types: Boolean, number, and String
(2) These types are similar to other reference types but also have special behaviors corresponding to their respective basic types
(3) Whenever a basic type value is read, the background creates an object of the corresponding base wrapper type, allowing us to invoke methods to manipulate these data princ
1.Global object. This object is special because it does not exist!-_-. If you declare
var Pointer=global;
An error was detected and the object could not be found. This is because in ECMAScript, each function is a method of an object, the isNaN (), Isfinite (), parseint (), and parsefloat () functions that we use, appear to be independent functions, but they are all functions of the global object.
Note the two functions used to process URL encoding:
The ECMAScript client model is the three client model introduced by SHAREPOINT2010. NET managed "," ECMAScript "," sliverlight "one kind, today just saw this, tried, also took out and everybody share under. I myself feel that the client model, and the SP's object model is not too different, is to use, even less handy. Today wrote the next script, a variety of not so, all kinds of debugging, all kinds of dep
"Everything is Object" knows this in object-oriented programming languages, but it's a feeling for me, sensed it's hard to say. Because I am on JavaScript and weak, so look at the ASP.net Ajax class library at the same time also turned out ECMAScript by the way learn. All classes in. NET inherit from object, as well as in JS, so that if an object is extended, all descendants of the object class must have ancestry.
Now that I'm learning JavaScript, I'
The statements in ECMAScript. if you want to learn JavaScript, you can refer to the if statement.
Syntax:
The Code is as follows:
If (condition ){Statement1;}Else {Statement2;}
Iteration statement
1. do-while statement
Syntax:
The Code is as follows:
Do {Statement} While (expression );
2. while statement
Syntax:
The Code is as follows:
While (expression ){Statement}
3. for statement
Syntax:
The Code is as follows:
For (initialization; e
Remaining Parameters of ECMAScript6 function (Rest Parameters), ecmascript
We know that the JS function has an arguments object and we can get all the real parameters. Now ES6 brings us a new object, and we can get the parameters except the start parameter, that is, the remaining parameters (a lot of nonsense O (operator _ operator) O ~).
This new object is different from arguments. It is a common identifier customized by the programmer. You just need
Refer to Nanyi's book ECMAScript 6 primer, thanks Nandashin!
Let and const command let command
ES6 has a new let command to declare variables. Its usage is similar to Var, but the declared variable is valid only within the code block where the Let command resides.
Basic usage
var a = [];for (var010; i++) { function () { console.log(i); };}a[6// 10var a = [];for (let010; i++) { function () { console.log(i); }
Generally, three types of objects can be created and used:
1. Native object)
Definition: objects provided by ecmascript implementation independent of the host environment
(Actually the class defined by the ECMA-262)
Object Function Array string Boolean number date Regexp error evalerror rangeerror
Referenceerror syntaxerror typeerror urierror
2. build-in object)
(In fact, both built-in and local objects do not need to be instantia
ECMAScript is a script programming language that is standardized by the ECMA International (formerly the European Association of Computer manufacturers, the English name is European Computer Manufacturers Association) through ECMA-262. This language is widely used on the World Wide Web, and it is often referred to as JavaScript or JScript, but in fact the latter two are implementations and extensions of the ECMA-262 standard.ECMAScript is the specific
"Everything is Object" knows this in object-oriented programming languages, but it's a feeling for me, sensed it's hard to say. Because I am on JavaScript and weak, so look at the ASP.net Ajax class library at the same time also turned out ECMAScript by the way learn. All classes in. NET inherit from object, as well as in JS, so that if an object is extended, all descendants of the object class must have ancestry.Now that I'm learning JavaScript, I'm
One of the most reasonable javasscript coding specifications. _ Translate from:Https://github.com/airbnb/javascript
Note : This guide assumes that you are using Babel and requires that you use BABEL-PRESET-AIRBNB or a comparable preset plug-in. It also assumes that you are installing shims/polyfills, utility airbnb-browser-shims, or equivalent plug-ins in your application.
directory type referencing object array deconstruction String function arrow function class and constructor module iterator
Boolean value:
If one operand is an object and the other is a Boolean value, return the object
If two operands are objects, the second object is returned
If a shipment count is NULL, return null
If a shipping count is Nan, return nan
If an op count is undefined, an error occurs.
The logical and is also a simple operation in ECMAScript, that is, if the first operand determines the result, the second operand is no longer computed, and the example:
Ajax|asp.net|object
"Everything is Object" knows this in object-oriented programming languages, but it's a feeling for me, sensed it's hard to say. Because I am on JavaScript and weak, so look at the ASP.net Ajax class library at the same time also turned out ECMAScript by the way learn. All classes in. NET inherit from object, as well as in JS, so that if an object is extended, all descendants of the object class must have ancestry.
Now that I'm lear
1. If statement
If statement Syntax:
If(Condition) statement1ElseStatement2
2. Iterative statements
An Iteration statement is also called a loop statement. It declares a group of commands that need to be executed repeatedly until certain conditions are met. Ecmascript provides four types of iteration statements for this processing.
2.1 Do-while statement
The do-while statement is a post-test loop, that is, the exit condition inside the exe
2.1 syntax
Case-sensitive, weak variable type, line-and-tail semicolons are optional, comments are double-slashes, and parentheses indicateCodeBlock
2.2 Variables
Variables are declared using VAR. Naming rules for variables: the first character must be a letter, underline, or dollar sign; the remaining characters can be an underscore, dollar sign, or any letter or digit.
Variable naming rules:
camel Tag Method : lowercase letter. The following words start with an uppercase letter.
When developing applications using the ecmascript object model, we do not consciously want to know what methods a certain SP object provides? Here we will look at how to do it.1. Add a visual webpart (named wplkecmascript) and a Javascript file (named ecmaoplistitems. JS) to the SharePoint project we created earlier)The code for ecmaoplistitems. JS is as follows. This code is used in the previous introduction to extract website attributes.// Retrive w
2.1 syntax
Case-sensitive, weak variable type, line-and-tail semicolons are optional, comments are diagonal lines, and parentheses indicate code blocks.
2.2 VariablesVariables are declared using var. Naming rules for variables: the first character must be a letter, underline, or dollar sign; the remaining characters can be an underscore, dollar sign, or any letter or digit.
Variable naming rules:
Camel markup: the first letter is lowercase, and the subsequent words start with an uppercase lette
. Forced type conversionThe mandatory conversions available in ECMAScript are as follows:Boolean (value) -- converts a given value to a Boolean value.Number (value) -- converts a given value to a Number (which can be an integer or floating point Number)String (value) -- converts a given value to a String.Example:Copy codeCode: var b1 = Boolean (""); // false-empty stringVar b2 = Boolean ("hi"); // true-not empty stringVar b3 = Boolean (100); // true-n
milliseconds and convert it to the current date varDate =NewDate (); varTime = Date.gettime ()-10000000000; //Date construction method, can be filled in green millisecond number varDate2 =NewDate (time); //Alert (date2.tolocalestring ());8.REGEXP Objects (Regular)This object is used during form validation to verify that the user-populated string conforms to the rule.Create a regular object mode 1 parameter 1 regular expression parameter 2 Validate mode g global/i ignore case/M multiple li
2.1 syntaxCase-sensitive, weak variable type, line-and-tail semicolons are optional, comments are diagonal lines, and parentheses indicate code blocks.2.2 VariablesVariables are declared using var. Naming rules for variables: the first character must be a letter, underline, or dollar sign; the remaining characters can be an underscore, dollar sign, or any letter or digit.Variable naming rules:Camel markup: the first letter is lowercase, and the subsequent words start with an uppercase letter. Fo
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.