Answer and Explanation:
Using Javascript:
We could just use ES6 syntax and quickly get our result with no long coding. ECMA script 2015, the sixth version of javascript programming language has an array method that returns the unique values of an array in a new array.
var allValues = [ 1,3,4,1,3,9 ];
let uniqueValues = [...new Set(allValues)];
console.log(uniqueValues);
This will output only the unique values 1,3,4,9