JavaScript Basics Tutorial Arithmetic operators
Operator
Operator description
Example
Example description
+
Addition
X+y
If x is an integer 2,y is an integer 5, x+y equals 7If x is the string "Text1"
The Array.prototype.forEach () method lets each item of an array perform a given function once. -mdn
Suppose there was such a scene that you got such an array of
[{symbol: "XFX", price:240.22, volume:23432},{symbol: "TNZ", price:332.19, volume:234}
Learning to parse the JSON string today, using an eval () method, why do I need parentheses when parsing a string? I can't touch my head. The original JavaScript {} statement block is ambiguous, without parentheses there will be errors,
[2007-04-11 14:31:50 | Author:never-online]
First of all, please download jscript.chm this manual, no matter novice veteran, there is a manual is unavoidable, especially for beginners, if you do not Flip Rhino book, then this manual will be your
Copy Code code as follows:
The FileSize attribute of JavaScript and IMG itself under IE is applied. In addition, IMG has several other attributes, such as Filecreateddate, Filemodifieddate, FileSize, fileupdateddate, filters, we can
About Reverse References
Copy Code code as follows:
Test function
function Matchreg (Reg, str) {
var result = Str.match (reg);
if (result) {
Console.dir (result);
} else {
Console.log (' match failed ');
}
}
var
Method definitionCall Method:Syntax: Call ([thisobj[,arg1[, arg2[, [,. argn]]]]Definition: Invokes one method of an object, replacing the current object with another object.DescriptionThe call method can be used to invoke a method instead of another
Hoisting mechanism
The JavaScript variable declaration has a hoisting mechanism that, when executed, promotes the declaration of all variables to the front of the current scope.
Read a piece of code first
var v = "Hello";
(function () {
When it comes to setinterval, you have to mention settimeout, both of which are used to perform a function on a regular basis, the difference being that settimeout is executed only once, and setinterval can be executed continuously, typically as
1. About this object
Copy Code code as follows:
View Plaincopy to Clipboardprint?
var obj1=new Object ();
var obj2=new Object ();
Add attribute p to all two objects, equal to 1 and 2 respectively
Obj1.p=1;
obj2.p=2;
1. Click event ___onclick
The event that occurs when the user clicks the mouse button. The event handler or code specified by the onclick is invoked to execute.
such as:
2. Change Event ___onchange
Occurs when the character value within the text
Objective
Replace the first argument generally places a regular expression that matches the text you want to replace, and the second argument, in general, we put in a string that replaces the text that is being matched.
In fact, the replace is far
In the presence of such a variable TT, it satisfies the following code.
After the code executes, errcount=0 and the assertion function never has alert information
The code is as follows:
Copy Code code as follows:
Magic variables in
Let's take a look at the official explanation:
Call method
Please see
Apply to: Function Object
Requirements
Version 5.5
Invokes one of the object's methods to replace the current object with another object.
Call ([thisobj[,arg1[, arg2[, [,. argn]]]]
1.document.write (""); Output statement
The annotation in 2.JS is//
3. Traditional HTML Document order is:document->html-> (head,body)
4. The DOM order in a browser window is:window-> (navigator,screen,history,location,document)
5. Get the name
Both simple and complex web applications are made up of HTML, JavaScript, and CSS files. Developers typically use a third-party JavaScript framework such as jquery, knockout, underscore, etc. to improve development speed. Because these JavaScript
Preface --speak in front
I think there are a lot of beginner friends who used to have little access to the background programming language, like me, confused a series of "nouns" in JavaScript. Seems to know what to say, but the understanding is
There are three kinds of programming errors: (1) syntax errors and (2) Run-time error (3) logic errors:syntax error:
Syntax errors, also known as parsing errors, are performed at compile time in a traditional programming language and appear in
The JavaScript date.setutcseconds () method specifies a date according to the universal Time set by seconds.Grammar
Date.setutcseconds (secondsvalue[, Msvalue])
Note: The data inside and outside the brackets is optional
The following
The JavaScript date.getyear () method returns the year of the specified date according to the Universal Time. GetYear is no longer in use and has been replaced with the getFullYear method.
The value returned by GetYear is the current year minus 1900
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