看來,碼頭應用服務器上的隨機UDP端口監聽(範圍介於30000和50000) $ netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
..
udp 0 0 *:35462 *:*
作爲標題說我想總結使用for循環遍歷數組。 你可以給我一些指導,說明我在哪裏會出錯。我將返回值NaN。 var total = 0;
function sum(input) {
for (idx=0; idx<=input; idx++) {
total += input[idx];
}
return total;
}