I have json object and i want to search for a key in it and return that Object key as a result if the key matches. consider the following example
obj = {
"India": {
"Karnataka": ["Bangalore", "Mysore"],
"Maharashtra": ["Mumbai", "Pune"]
},
"USA": {
"Texas": ["Dallas", "Houston"],
"IL": ["Chicago", "Aurora", "Pune"]
}
}
input: Pune
output: ['Maharashtra','IL']
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…