Set

  1. const arr = [1,1,2,2,3,3,3,4,4,5,6,7,7]
  2. const newArr = [...new Set(arr)]

filter

  1. const arr = [1,1,2,2,3,3,3,4,4,5,6,7,7]
  2. const newArr = arr.filter((item, index, arr) => {
  3. return arr.indexOf(item) === index
  4. })