Jquery Loop and array

Discussion in 'jQuery' started by ghosh.ag, Mar 18, 2011.

  1. #1
    Hi,

    What is the syntax of loop in jquery, what is the procedure to declare single dimension & multi dimension array in jquery.

    Thanks
     
    ghosh.ag, Mar 18, 2011 IP
  2. Jan Novak

    Jan Novak Peon

    Messages:
    121
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    0
    #2
    for objects and arrays, you can use jQuery.each()
    more with examples here: http://api.jquery.com/jQuery.each/


    use standard convetions from ECMA-262. They are supported in every browser. Here is more info about arrays, methods for array, multidimensional array, intro of limitations of "associative" arrays etc...
    http://www.hunlock.com/blogs/Mastering_Javascript_Arrays

    in jQuery, there are supported features working with arrays, look at documentation for examples:

    jQuery.isArray()
    Determine whether the argument is an array.

    jQuery.makeArray()
    Convert an array-like object into a true JavaScript array.

    jQuery.map()
    Translate all items in an array or array-like object to another array of items.

    jQuery.merge()
    Merge the contents of two arrays together into the first array.

    jQuery.grep()
    Finds the elements of an array which satisfy a filter function. The original array is not affected.
     
    Jan Novak, Mar 18, 2011 IP