JavaScript function section

Source: Internet
Author: User

Function Section Learning:
+parseint ():
The-parseint () function converts any input value it receives (usually a string) to an integer type output, and returns Nan if the conversion fails.
-parseint ("parameter", second parameter cardinality): No second parameter specified, function will default it to decimal
-If the argument is beginning with 0x, the default is hexadecimal
-If the argument starts with 0, the default is octal
+parsefloat ():
-Converts input values to decimal numbers only
! is discarded when the first exception character is encountered, regardless of whether the remaining part of the string is available
-parsefloat () can also accept data in the form of an exponent, which represents 10 of the negative parties, plus or not representing 10 of the positive several parties
-
+isnan ():
The-nan itself does not have the concept of equivalence, so nan = = = The return of Nan is false
+isfinite ():
-Check whether the input is a number that is neither infinity nor Nan
+encodeuri (), encodeURIComponent (), decodeURI (), decodeURIComponent ()
+eval ():
-Executes the input string as a JS code
+alert ():
-All current code will be paused until the execution window of alert () is closed
+ About ascension: The reference code is as follows:
-var a = 123;

function f () {
alert (a);
var a = 1;
alert (a);
}

f (); /function domain is always better than global domain/
-So the first alert (a) is actually the reality of undefined
+ function identifier notation:
-var f = function () {
return 1;
}
-var f = function MyFunc () {
return 1;
}
-In JS The function is also a kind of data:
-What they contain is the code
-they are executable (or callable)
-var sum = function (A, b) {
return a + B;
}
-var add = sum;

JavaScript function section

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.