unique :function (array){ var n = {}, r = [], len = array.length, val, type; for (var i = 0; i < array.length; i++) { val = array[i]; type = typeof val; if (!n[val]) { n[val] = [type]; r.push(val); } else if (n[val].indexOf(type) < 0) { n[val].push(…
/** * 去除重复数据 * @author Sunqinbo */ public class RemoveDuplicateData { public static void main(String[] args) { Integer[] a = new Integer[] { 1, 4, 5, 2, -6, 5, 9, 10, 10 }; Set<Integer> set = new HashSet<Integer>(); for (int i = 0; i < a.le…