JS----Array processing splice (with JS primitive AddClass method OH)

Source: Internet
Author: User

Last time a carousel was written: http://blog.csdn.net/stronglyh/article/details/46833499

Because people asked me when, gave me HTML, so I saw the page quoted jquery, so I wrote with jquery, today, I think of a addclass in jquery, do not know whether the traditional JS can be used to fix it.

Where the splice method was used when deleting

For this method, there are a total of three more commonly used usage, explained in detail below:

1. Delete-Used to delete elements, two parameters, first parameter (to remove the position of the first item), second parameter (number of items to delete)
2. Insert-Inserts any item element into the specified position in the array. Three parameters, first parameter (in fact position), second argument (0), third parameter (inserted item)
3. Replace-Inserts any item element at the specified position in the array, deleting any number of items, three parameters. First parameter (start position), second parameter (number of items deleted), third parameter (insert any number of items)

So now everyone should know how to use it, and suddenly found that jquery is more convenient ah.



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

JS----Array processing splice (with JS primitive AddClass method OH)

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.