使用 for in 循环遍历 javascript 对象时,如何访问 for 循环内迭代器的位置?
a = {some: 1, thing: 2};
for (obj in a) {
if (/* How can I access the first iteration*/) {
// Do something different on the first iteration
}
else {
// Do something
}
}