static/js/util.js
/**
 * Filter an array to unique elements while keeping order.
 * @function arrUniq
 * @param {Array} arr - input array
 * @returns {Object} output object
 * @see {@link https://stackoverflow.com/questions/9229645/}
 */
Filter an array to unique elements while keeping order.
Filter an array to unique elements while keeping order .
function arrUniq(arr) {
  const res = [];
  const used = {};
  const n = arr.length;
  let j = 0;
  let item;
  for (let i = 0; i < n; i++) {
    item = arr[i];
    if (used[item] !== 1) {
      used[item] = 1;
      res[j++] = item;
    }
  }
  return res;
}
function arrUniq ( arr ) { const res = [ ] ; const used = { } ; const n = arr . length ; let j = 0 ; let item ; for ( let i = 0 ; i < n ; i ++ ) { item = arr [ i ] ; if ( used [ item ] !== 1 ) { used [ item ] = 1 ; res [ j ++ ] = item ; } } return res ; }
Filter an array to unique elements while keeping order.
Filter an array to unique elements while keeping order .