Skip to content

Instantly share code, notes, and snippets.

@Obre
Created March 31, 2017 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Obre/56344a1a0e0ac90ee407dd5123762239 to your computer and use it in GitHub Desktop.
Save Obre/56344a1a0e0ac90ee407dd5123762239 to your computer and use it in GitHub Desktop.
function solution(myArr) {
var myArr = [9, 3, 9, 3, 9, 7, 9];
var leng = myArr.length;
var result = [];
var leftObj = {};
var i;
for (i = 0; i < leng; i++) {
leftObj[myArr[i]] = 0;
}
for (i in leftObj) {
result.push(i);
}
console.log(result);
}
solution();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment