js 去除最后一个逗号

var reg = /,$/gi; 
 ids = ids.replace(reg,"");
原文地址:https://www.cnblogs.com/zt528/p/5408546.html