ES 7 new feature finishing

Source: Internet
Author: User

1. Let, you can declare a variable by using allow instead of Var. Variables with let declarations have block-level scopes that take effect only in code blocks

2. const, using const declaration constants, once declared, cannot be changed

3. Pattern matching

var [A, B, c] = [1, 2, 3]

4. New String method

  • Contains can find if a string is contained within B
  • StartsWith can see if a string starts at another string
  • EndsWith to see if a string is at the end of another string
  • Repeat returns a new string that copies the original string n times

5. Global methods parseint and parsefloat are moved to the number object, using the same method

6. Number.isinteger () is used to determine whether a number is an integer, because the floating-point and integer storage methods are the same, so 3.0 and 3 are the same value

7. Math.trunc () is used to remove a decimal part of a number, returning an integral part

8. The find () method of the array object to find the first qualifying array element

9. Array.observe () and Array.unobserve () These two objects are used to listen for and suppress changes in the listening array

ES 7 new feature finishing

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.