-5
試想一下,我有一個嵌套的對象像下面的一個內部對象的名稱:如何獲得一個對象的JavaScript
{
"post":{
"hello":{
// what's in here doesn't matter
}
"test":{
// also doesn't matter
}
}
,是有什麼辦法讓對象名稱裏面後,以一個這樣的數組:
["hello", "test"]
'Object.keys(obj.post)'。 – Tushar