JS Study Notes (1)

Source: Internet
Author: User
    • Case Sensitive
    • A semicolon at the end of a sentence is dispensable, but omitting a semicolon is not a good programming habit.
    • Three basic data types: Numbers, text strings, and boolean values

There are two types of small data: NULL (null) and undefined (undefined). They define only one value.

Composite data types: objects, arrays, and functions

    • Javascript can recognize the direct number of hexadecimal numbers. The so-called direct number of hexadecimal is started with "0x" or "0x. The ecmascript standard does not support octal, so some JavaScript supports octal, but some do not. octal is a number starting with 0. Therefore, it is best not to add a useless 0 before the number.
    • Javascript has a large number of arithmetic functions. For convenience, these functions are saved as attributes of the math object. Therefore, we always use direct numbers to access these functions. For example
 
VaR A = math. Sin (X)
     
     
  • The tostring () method of the numeric type: If the parameter is not included, it is converted to decimal. If the parameter is included, it is converted to the corresponding hexadecimal format. For example
    VaR A = (23). tostring (2) // convert to binary. If you call this method directly using numbers, use parentheses.
    To prevent decimal point processing.
  • Nan is a special value that represents a non-numeric value. In particular, it is not equal to itself. To determine whether a value is Nan, use the isnan () function to detect it.
  • A function in JS is a data type, which means that the function can be stored in variables, arrays, and objects, and the function can also be passed as a parameter to other functions.
  • 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.