Using the native method uniq() from prototype to getUniques () and improving performance storing the length of some for's