|
insert
Overview of insert
insertAction that inserts an item (or set of items) into another. Usageobjx( object ).insert( index, items );
Examplevar a = [1,2,4,5]; var b == objx(a).insert(2, 3).obj(); // b == [1,2,3,4,5] Inserting at the endinsert does not support inserting items to the end of an array or string, instead consider the append plugin. The following code will add items before the last item: var a = ["I","like","to","say","World"]; objx(a).insert(-1, "Hello"); // a = ["I","like","to","say","Hello","World"] | ||||||
► Sign in to add a comment