SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need to find index of object in multidimensional array

    I have an array "arr" that is an array of objects. Each object has the same 7 properties.

    I want to find the index of the object with a property that matches a certain value x in the array arr. How can i accomplish this?

    The array has hash tables associated with it.

    arr [ obj [ i ] . property1 + "_" + obj [ i ] . property2 ] = arr [ i ] ;

    so whats the index of the object where .property1 = x ?

    Thanks, g

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry that should be


    arr [ arr [ i ] . property1 + "_" + arr [ i ] . property2 ] = arr [ i ] ;


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •