错误示例:
for (var i = 0; i < 6; i++) { // var unique = seqer.gensym(); var unique = i + '123'; document.writeln(unique[i] + ","); };
输出结果为:0, 1, 2, 3, undefined, undefined,
正确示例:
for (var i = 0; i < 6; i++) { // var unique = seqer.gensym(); var unique = i + '123'; document.writeln(unique + ","); };
正确示例:
for (var i = 0; i < 6; i++) { // var unique = seqer.gensym(); var unique = []; unique[i] = i + '123'; document.writeln(unique[i] + ","); };
输出结果为:0123, 1123, 2123, 3123, 4123, 5123,
==TBC==