Javascript做一个Integer to Array转换

时间:2014-04-29 16:26:02

标签: javascript jquery arrays

我在javascript中有一个变量,名为id_equipamento

当我这样做时:

id_equipamento = 75;
var chips = new Array();

$("table#sample_1 > tbody > tr").each(function(index, row) {
var chip = {
    "id_tracker": id_equipamento,
    "id_chip": $(row).attr("id")
};
console.log(id_equipamento);
chips.push(chip);
    delete chip;
});

在每个之前,id_equipamento是75,但是当我这样做时:

var chip = {
"id_tracker": id_equipamento,
"id_chip": $(row).attr("id")
};

id_equipamentoArray中,console.log我看到了以下输出:

["75"] 

但我没有做任何转换。为什么JS这样做?

0 个答案:

没有答案