JS 字符串轉數組:
var words =' likely, likely, likely,economic, economic'; //字符串中間已特殊符號隔開
var words = words.split(","); //轉成數組類似php的explode函數
JS 字符串去重:
function unique (array){
return array.filter(function(el, index, arr) {
return index == arr.indexOf(el);
});
}
歡迎關注,有問題一起學習歡迎留言、評論。