JS Learning Note (continue)

Source: Internet
Author: User

Escape character
Constant line of blank lattice nbsp:1 2
Half-square-large blank ensp 1 2
The whole square big blank Emsp 1 2
Less than sign < &lt;
Greater than sign > &gt;
Double quote "&quot;
Ampersand & &amp;
Other please refer to http://114.xixik.com/character/

Localcompare () Compare the position of a string based on the implementation in different places

Math Object
Math.ceil () Fetch up
Math.floor () Take down
Math.Round () rounding
1>math.random () >=0

Execution Environment
var a= "123";
function S () {
A= "456";
}
alert (a); A has a value of 123

With (location) {
alert (HREF);
}
The WITH statement can extend the scope chain, and the catch block in a try catch can also
"Use strict" mode cannot be used more with,with will affect performance
Since JavaScript does not have block-level scopes, variables are not visible outside when variables are defined inside the function using var.
Variables are visible without using the VAR definition.

The two common types of garbage collection in JS are token cleanup and reference counts.
You can use Window.collectgarbage () to force garbage collection in IE
If you want to manually manage memory, you can explicitly de-reference the memory


Json.stringify ({a:1,b:2},function f (key, value) {
Console.log (value);
if (typeof value = = = "Number") {
Value = 2 * value;
}
return value;
})
In the above code, the object o will be processed three times by the F function altogether. The first key name is NULL, the key value is the entire object o, the second key is named a, the key value is {b:1}, the third key is named B, and the key value is 1.

JS Learning Note (continue)

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.