109
rated 0 times
[
113]
[
4]
/ answers: 1 / hits: 18991
/ 14 Years ago, tue, march 1, 2011, 12:00:00
I have an array item like this:
var array = USA.NY[2];
// gives Albany
{USA : {
NY : [New York City, Long Island, Albany]
}}
I want to find the state from just having the array. How do I do this? Thanks.
function findParent(array) {
// do something
// return NY
}
More From » arrays