var goal = [];
var localGoal = [
{a:'a', b:'b', c:'c'},
{a:'e', b:'f', c:'g'},
{a:'h', b:'i', c:'j'}];
function add () {
$.each(localGoal, function(index, val) {
var temp = {};
temp.tempa = val.a;
temp.tempb = val.b;
temp.tempc = val.c;
goal.push(temp);
console.log(goal);
});
}
var main = function () {
add();
}
main();
Chrome 的 console 里面的打印结果很奇怪。
http://stackoverflow.com/questions/24175017/google-chrome-console-log-...