function fn (arg) {
var result = [];
var obj = {}
for(var i = 0; i < arg.length; i++) {
obj[arg[i]] = arg[i];
}
for(var i in obj) {
result.push(obj[i])
}
return result;
}
var arg = fn([22,22,1,2,2,1,1,3,4,5,6,10000, 10000, 1000000,1000000,1000000,1000000,1000000, 'privet', 'privet', 'str', 'str']);
console.log(arg)