First are the variable definitions. 'i' is a idnex to the loop, and is later used as a value holder. 'len' is just shorthand for array.length. 'out' is a new array that is built as the function processes. Finally, 'obj' is an object where we store the values as we get them.
Now, we have the first loop, which iterates over the input array. Inside that loop, we create a property in obj using the array's values as property names and '0' as the property value. If any elements of the array have duplicate values, the same property name in 'obj' will be used ( this is where the duplicates are removed ).
Next Loop, we have a for loop on the properties in 'obj', and pushing those property names onto the 'out' array.
And the last line returns our 'out' array.