Pay for Hesitation: for-each-in & for-in
Pay for Hesitation
Ideas are Worthless Unless Acted Upon
Pages
Home
Authors
2010年8月17日 星期二
for-each-in & for-in
for-in : iterates over key set.
for-each-in : iterates over value set.
var info:Object = new Object();
info.city = "Toronto";
info.country = "Canada";
for each(var values:* in info){
trace(detail);
}
trace("\n");
for (var key:* in info){
trace(key);
}
Output:
Toronto
Canada
city
country
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言