這段代碼必須有一些非常簡單的錯誤,但它不會排序。這是爲什麼?javascript排序整數失敗
$(document).ready(function() {
var topArray = [];
topArray.push(1000);
topArray.push(298);
topArray.push(2000);
topArray.sort();
alert(topArray[0] + "," + topArray[1] + ", " + topArray[2]);
})