Wednesday, 14 August 2013

How to convert this array of strings to array object

How to convert this array of strings to array object

I ma having this string returned from my C# code. I need to implement
Google Maps. How d i convert this into array.
String
var array = [["Andover - Wyevale Garden Centre","Concession A","Andover
Garden Centre","Salisbury Road","Andover","SP11 7DN","01264 710114","14.9
miles","51.1998552","-1.5111393"],
["Portsmouth - Gunwharf Quays","Unit 29","Gunwharf
Quays","Portsmouth","Hampshire","PO1 3TZ","02392 819558","20.8
miles","50.7963663","-1.1065603"],
["Chichester","83 North Street","Chichester","West Sussex","PO19
1LQ","01243 380058","25.9 miles","50.837269","-0.77846"],
["Newport - Isle of Wight","117/119 High Street","Newport","Isle of
Wight","PO30 1TP","01983 527485","27.1
miles","50.700399","-1.294872"],
["Guildford","20-21 North Street","Guildford","Surrey","GU1
4AF","01483 456978","29.8 miles","51.2369881","-0.5731617"]]
i dont know but when i do array[1][0] it should return "Portsmouth" in
chrome console BUT it is coming as undefined.
I suspect array variable is identified as string and not array.
when i do array[0][4] i get "A" as output.
Please help

No comments:

Post a Comment