2017-03-21 17 views
0
 

    { 
     "123": { 
     "question": "Alert Me When Redmi 3S Available jan-18th 12 noon on FLIPKART.", 
     "answer": [ 
      "Battery is removable or non-removable?", 
      "NON-REMOVABLE ..... but powerful battery..." 
     ] 
     }, 
     "124": { 
     "question": "Can we use Jio SIM in this phone?", 
     "answer": [ 
      "Yeah of course\n", 
      "I don't think so it supports Jio sim card" 
     ] 
     }, 
     "125": { 
     "question": "Is MI note 4 supports 4G?", 
     "answer": [ 
      "Yeah of course\n", 
      "I don't think so it supports Jio sim card" 
     ] 
     } 
    } 

+1

['for..in'](https://developer.mozilla.org/en-US/文檔/網絡/的JavaScript /指南/ Loops_and_iteration#爲... in_statement) – hindmost

回答

2

你可以試試這個eample:

var jsonVar = /* Your JSON */; 
for (id in jsonVar) { 
    console.log(jsonVarp[id]); 
}