1, first install the Sublimecodeintel package.Enter Sublime, enter package management via CTRL+SHIFT+P, input PCI (first letter), select Packages Contrl:intall,Enter the package installation interface, input the initial letter, select
FunctionClosed PackagePresentation formatPrinciples of nested functionsInformation hiding through closuresThis section is mainly about function class and closure of the heavy difficulties.Function
Generate representations
var obj=
Scope of the variable:Each function defines the scope, and the function is declared internally with Var, whose scope is only useful within this function. Functions can be used to create function scopes. At this point the function is like a
StatementA script is a series of computers that can follow the instructions step-by-step. Each individual instruction or step is referred to as a statement. The statement should end with a semicolon.A statement is an instruction, an instruction, or
Think hdoj the topic font is too small, a wave of small operationIn the Favorites Bar add: Add page--URL to:1 void (function() {2 var element = Document.getelementsbyclassname (' Panel_ Content '); 3 for (var i = 0; i ) {4 element[i]
Day.js IntroductionIn the use of JavaScript processing time, the use of moment.js, but it is too heavy, there are more than 200 K, the general project may also only use a few APIs, so, here is recommended a lightweight time library-day.js. The
Functions are also objects, owning properties and methods, just like ordinary objects.1,length PropertyArguments.lenght indicates the number of arguments passed in.The length property of the function is read-only and represents the number of formal
1 DOCTYPE HTML>2 HTML>3 Head>4 MetaCharSet= "Utf-8">5 title>Variable declarationtitle>6 Head>7 Body>8 Scripttype= "Text/javascript">9 /*//In a JavaScript programTen var sum; One //You can also declare multiple variables by using the var
1. typeof operator: Determines what type an object is, returns ""First, Number type1, JavaScript is not good at calculation, can not be used for floating-point calculation. such as: var a = 0.2; var B = 0.1; -A + b = 0.30000000000000042, Nan means
HTML>Head>Scripttype= "Text/javascript">functionCreatenewdoc () {varNew_doc=Document.open ("text/html","Replace"); vartxt= " This is the new document "; New_doc.write (TXT); New_doc.close ();}Script>Head>Body>Buttononclick= "Createnewdoc
Web page Visible area width: document.body.clientWidthWeb page Visible Area height: document.body.clientHeightWeb page Visible Area width: document.body.offsetWidth (including edge width)Web page Visible Area High: document.body.offsetHeight
First, JS basic concepts 1, naming rules
The variable name is case-sensitive (test and test are two different variable names), and the identifier is in the hump naming format, namely: the first letter is lowercase, and each of
JavaScript language is a "single-threaded" language, unlike the Java language, class inherits thread and then a thread.start can open a thread, so JavaScript is like a pipeline , just a pipeline, It is either processed or packaged, and multiple
For adding two click events to the same element, one of them is to add a click event via the JS fetch element and the other is to add an event to the element by inline method.Only click events obtained through the element are executed after
var arr = [1,-1,2,4,5,5,6,7,5,8,6];var maxval = arr[0]; The maximum value in the array var minval = arr[0]; The minimum value in the array var mostval; The most frequently occurring element in the array is var tempobj = {};var num = 0;for (var i=arr.
ObjectiveRecently there is always a feeling, for knowledge does not accumulate, often forget where to go to check, such as JS this language, is a waste of time, if you can put these knowledge into the knowledge system to plug into the brain, so that
First, the callback functionThis is the most basic method of asynchronous programming.Assume that there are two functions F1 and F2, which wait for the result of the former execution.
F1 ();
F2 ();
If F1 is a time-consuming task,
JavaScript Variables
variable names must begin with a letter or underscore ("_")variables can also start with the $ and _ symbols (although we do not recommend this)variable names are case sensitive (y and y are different variables)variables
There are two methods in the array that can be used for direct ordering, namely reverse () and sort (). The following through this article to you in detail, on the JS array reordering related knowledge of interested friends to see it together. 1.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service