views:

57691

answers:

5

Hi,

I am using jQuery in my web-app I want to use arrays, but I am not able to find out functions for arrays (add, remove or append elements in array) in jquery, Can anyone share with me any link related to jQuery array functions which will explain the jquery array functions.

Thanks

+5  A: 

Jquery has very limited array functions since javascript has most of them itself. But here are tehe ones they have: http://docs.jquery.com/Utilities

Pim Jager
+18  A: 

Have a look at https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/Array for documentation on JavaScript Arrays.
jQuery is a library which adds some magic to JavaScript which is a capable and featurefull scripting language. The libraries just fill in the gaps - get to know the core!

meouw
Coool, its very good, Thanks!
Prashant
+1  A: 

there's a plugin for jQuery called 'rich array' discussed here

Scott Evernden
+2  A: 

The Visual JQuery site has some great examples of JQuery's array functionality. (Click "Utilities" on the left-hand tab, then "Array and Object operations")

yalestar
+2  A: 

An easy way to get the max and min value in an array is as follows. This has been explained at get max & min values in array

var myarray = [5,8,2,4,11,7,3];
// Function to get the Max value in Array
Array.max = function( array ){
return Math.max.apply( Math, array );
};

// Function to get the Min value in Array
Array.min = function( array ){
return Math.min.apply( Math, array );
};
// Usage 
alert(Array.max(myarray));
alert(Array.min(myarray));
Taha