Remove Duplicate Characters

Remove duplicate characters from a string while keeping only the first occurrence of each character.

Code

General
[...new Set(str)].join('');

Parameters

The string to remove duplicates from

Browser·fetch() may be limited by CORS

More JavaScript Snippets