Learn JavaScript chapter III arrays from Mind Mapping

Source: Internet
Author: User

1 How to operate a logarithmic group:

1. Push (): Add an array at the end of the array

2.unshift (): Adding elements to the head of the array

3.concat () merging of two arrays

4pop () Delete the last element of the returned array

5shift () Delete and return the first element of the array

Splice (parameter 1, parameter 2, parameter 3):

Delete any number of entries: 1 starting subscript to delete 2 number of items to delete

Insert the specified entry in the development location: 1. Start Subscript 2.0 (do not delete any items) 3. Items to insert

Replace any number of entries: 1. Starting subscript 2. Number of items to delete 3. Items to insert

Slice (parameter 1, parameter 2): Select some elements from an existing array to form a new array

Parameter 1 returns the starting position of the item, and parameter 2 returns the end position of the item

If it is a negative number, use the array length plus the value to determine the position, the starting position is the actual subscript for the group, the end position of the actual subscript is the end array minus 1

Array sorting:

Reverse (): Reverses the order of the elements in the array

Sort (): Sorts a character or array of numbers by default, by string comparison

Array conversions:

ToString () is converted to a string and returns

toLocaleString () converts to a local format string and returns

Join () splits the array with the specified delimiter and converts to a string

Location Method:

IndexOf (parameter 1, parameter 2) is searched from the location of the array, and parameter 1 finds the entry 2 that represents the starting position of the lookup.

LastIndexOf (parameter 1, parameter 2) from the end of the array to find

Iterative method:????

Narrowing method:????

Learn JavaScript chapter III arrays from Mind Mapping

Related Article

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.