Rx Learning Note: JavaScript array manipulation

Source: Internet
Author: User
Tags javascript array

Rx Learning Note: JavaScript array operations 2016-07-03 additions and deletions elements

Unshift () Adding elements to an array switch

Array.unshift ("value"); Array.unshift (123); Array.unshift ("value1", "value2");

Push () Adds an element at the end of the array

Array.push ("value"); Array.push (123); Array.push ("value1", "value2")

Pop () popup (removed in array and as return value) array tail element

Array.pop (); var newvar=array.pop ();

Shift () pops the first element of the array

Array.shift (); var newvar=array.shift ();

Iterated algebraic groups

Map () Iteration (traversal operation) array element, returning the new array

Reduce () iterates over the array elements, returns calculated values, and can be used to calculate sums, product, etc.

Filter () filters the element, returning the new array

Reverse () reverse permutation, return new array

Array manipulation

Concat () merges the array, returning the new array

Join () merges the array elements into a single string that can be separated by the specified characters

Split () (string method) splits a string into a string array using a specific character

Rx Learning Note: JavaScript array manipulation

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.