回复 楼主 devilqin
因为的的splice的第三个参数错了,
你那样的写法是将"white,black,blue"看成一个整体,
如果写成这样:
queue.splice(1, 2 , "white","black","blue");
就不会发生排序错误了;
var queue = ["red","green","yellow","purple"];
queue.splice(1, 2 , "white","black","blue");
alert(queue.sort().toString());
//black,blue,purple,red,white