Array Object method Reference _ Basics

Source: Internet
Author: User
Concat method: Returns a new array, which is a combination of two or more arrays. Array1.concat ([item1[, item2[, ...) [, Itemn]]]

Join method: Returns a string value that contains all the elements of an array that is connected together, separated by the specified delimiter. Arrayobj.join (separator)

Pop method: Moves the last element in the divisor group and returns the element. Arrayobj.pop ()

Push method: Adds a new element to an array and returns the new length value of the array. Arrayobj.push ([Item1 [item2 [...] [Itemn]]])

Reverse method: Returns an Array object in which the order of elements is reversed. Arrayobj.reverse ()

Shift method: Moves the first element in the divisor group and returns the element. Arrayobj.shift ()

Slice method: Returns a section of an array. Arrayobj.slice (start, [end])

Sort method: Returns an Array object that has been sorted by an element. Arrayobj.sort (sortfunction)

Splice method: Removes one or more elements from an array and, if necessary, inserts a new element at the position of the removed element, returning the removed element. Arrayobj.splice (Start, DeleteCount, [item1[, item2[, ...) [, Itemn]]]

Unshift method: Inserts the specified element into the beginning of the array and returns the array. Arrayobj.unshift ([item1[, item2 [, ...] [, Itemn]]]

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.