Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save adamrosloniec/0b140381c2eece1f793a367f814ce709 to your computer and use it in GitHub Desktop.
Save adamrosloniec/0b140381c2eece1f793a367f814ce709 to your computer and use it in GitHub Desktop.
ES6 - Extract unique characters from string
dataOld = 'asdasdasdasdasdasdasda';
const dataNew = [...new Set(dataOld)].join('')
// 'asd'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment