In brief
Set keeps unique values. However, two separately created objects remain different, even if their properties appear to be the same.
Useful to know
Set is a collection of unique values. It is handy when from a list of repeating codes you want multiple without repetitions. Values can be primitives or references to objects. [1]
For example, [...new Set(['bg', 'en', 'bg'])] gives ['bg', 'en']. External square brackets with spread turn the result back into an array. This is its own short example, not a function for normalizing language codes.
The uppercase and lowercase letters do not automatically become the same. If the application rule considers 'BG' and 'bg' to be one code, you must first normalize them according to this rule. Set cannot guess it on its own.
In objects, uniqueness refers to the references themselves. Two separate literals {id: 1} are not a single object. To remove duplicated id entries, you need to extract or use the identifier instead of expecting a comparison of all nested properties.
Sources
For further detail and to check the information: