I got an array list like the data below. I want make a function, input a number like '203', then the function will return 2 value "John" & "d", but I don't know how to make it.
There is a return value when I key in console.log(data.i) in the browser developer tool console, but it showed nothing in real code execution.
var data = {
"John": {
"a": "200",
"b": "201",
"c": "202",
"d": "203",
"e": "204",
"f": "205"
},
"Allen": {
"y": "100",
"z": "103"
}
}
for (i in data) {
console.log(i); // return John, Allen...
for (var j in data.i) {
console.log(j[0]); //return nothing
}
}