var fruits = ["Banana", "Orange", "Apple", "Mango"];fruits.push("Kiwi")
The result of fruits will be:
Banana,Orange,Apple,Mango,Kiwi
2. Remove Array Elemen
var y = [1, 2, 3];
var removeItem = 2;
y = jQuery.grep(y, function(value) {
return value != removeItem;
});
orvar y = [1, 2, 3];
var removeItem = 2;
y.splice( $.inArray(removeItem, y), 1 );
orvar y = [1, 2, 3];
y.remove(2);
The result of fruits will be:
1,3
0 comments:
Post a Comment
Please leave a comment