我有一个javascript数组
var array=["83487","83488","83489","83490","83491"];
我想获得此数组的Count 我该如何计算 这是5。
答案 0 :(得分:3)
array.length;
或
array["length"];
答案 1 :(得分:0)
您可以使用length
属性:
var array=["83487","83488","83489","83490","83491"];
alert(array.length);
答案 2 :(得分:0)
<script>
function myFunction()
{
var sample = ["83487","83488","83489","83490","83491"];
alert(sample.length);
}
</script>
答案 3 :(得分:0)
使用array.length;它会返回数组中元素的数量