2017-05-30 153 views
1

我得到這個string[]遍歷字符串數組

enter image description here

但是當我遍歷它

subUrl(arr) { 
     for(let i of arr) { console.log(i); } 
} 

它不記錄任何東西。怎麼了?

+0

你能提供的'JSON.stringify(OBJ)''那裏是obj'你的數組對象的結果呢? – DoronG

回答

3

你的數據是內部數組的數組,你需要兩個循環

for (let firstarray of arr){ 
     for (let i of firstarray){ 
      console.log(i); 
     } 
    } 
+0

謝謝,但結果是一樣的。 – gsiradze

+0

你可以調試,看看 – Sajeetharan

+0

我把'console.log'放在這兩個裏面,而不是寫單個結果.. – gsiradze