Simplify uniqueList

This commit is contained in:
pyoor 2018-08-29 18:06:27 -04:00
parent 75369656ed
commit 813b6b2c84

View file

@ -97,15 +97,7 @@ class common extends utils {
* @returns {Array}
*/
static uniqueList (list) {
let tmp = {}
let r = []
for (let i = 0; i < list.length; i++) {
tmp[list[i]] = list[i]
}
for (let i in tmp) {
r.push(tmp[i])
}
return r
return list.filter((v, i, a) => a.indexOf(v) === i)
}
/**