以下javascript做什么?
var groups = countrylist.split(',');
for( var i = -1, group; group = groupsCounty[++i]; ){
...
}
Run Code Online (Sandbox Code Playgroud)
Que*_*tin 11
With i starting at -1
increase i by 1
get the ith element from the groupsCounty array
if there is no such element: stop
otherwise: assign it to group and carry on (with whatever "…" is)
Run Code Online (Sandbox Code Playgroud)
它是以下的优化版本:
for (var i = 0; i < groupsCounty.length; i++; ){
var group = groupsCounty[i];
…
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
155 次 |
| 最近记录: |