I've been trying to troubleshoot the error in my code with no success. I have a simple example of what I believe to be a two-dimensional array, but I keep getting an undefined error.
var city = 'London',
country = 'England';
var locate = [];
locate['London']['England'] = ['Jhon','Mike'];
for (i = 0; i < locate[city][country].length; i++) {
console.log(locate[city][country][i]);
}
Check out the jsbin http://jsbin.com/pixeluhojawa/1/
I'm struggling to figure out what I'm doing wrong in this example. Any help would be greatly appreciated.