beacons = {
"key": {
"one": "char",
"two": "sue",
"three": "johnny"
},
"key2": {
"one": "char",
"two": "sue",
"three": "johnny"
},
"key3": {
"one": "char",
"two": "cara",
"three": "johnny"
}
}
결과는 아래와 같아야하며 다음과 같은 방식으로 속성을 호출해야합니다. beaconsArray [1] .one ---> "char"
beaconsArray = [{
"one": "char",
"two": "sue",
"three": "johnny"
}, {
"one": "char",
"two": "sue",
"three": "johnny"
}, {
"one": "char",
"two": "sue",
"three": "johnny"
}]
var beacons = {
"key": { "one": "char", "two": "sue", "three": "johnny" }, "key2": { "one": "char", "two": "sue", "three": "johnny" }, "key3": { "one": "char", "two": "cara", "three": "johnny" }
};
var beaconsArray = [];
for(var key in beacons) {
beaconsArray.push(beacons[key]);
}
console.log(beaconsArray);
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다