Accessing comma separated data from an javascript array object

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • piyush12345
    New Member
    • Nov 2011
    • 5

    Accessing comma separated data from an javascript array object

    I have a global array to which I provide data from one function and want to use that data into another function.

    i.e. i get the values of sitecode, x and y from function A
    siteCode = x = y =

    windQueryDataAr ray = [[siteCode, x, y]];

    I want to use this array in function B from which I want to compare value of siteCode with site code value I am getting from another source in function B to match the values of x and y accordingly... how can I do this?


    Sample of windQueryDataAr ray's data is
    ("KAXA", 92.144, 91.222)

    ("KCID", 91.111, 93.212)


    Thanks in advance!

    Piyush
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Firstly, you need to access the sitecode value. That would be as simple as
    Code:
    windQueryDataArray[i][0]
    for the ith data point.

    Comment

    Working...