Refactored uniq
Used ternary operator to assign prevVal in reduce
used ternary operator for return value in every
used ternary operator in return value for some
Code clean up